r/learnjavascript • u/best_codes • Feb 08 '24
How I Built a Profanity Blocking JavaScript Library 🤬 ⚡
How I Built a Profanity Blocking JavaScript Library
Introduction
As developers, we often come across situations where we need to filter and sanitize text to block or remove profanity. To tackle this problem, I decided to create a JavaScript library called bc-ProfanityBlock. In this article, I will walk you through the steps I took to build this library and explain how it can be used to effectively block profanity in your applications.
Step 1: Defining the Problem
The first step in building any library is to clearly define the problem we are trying to solve. In this case, the problem was to create, well, a solution that could detect and handle profanity in text. Profanity can be present in various forms, including common words, variations, and even with evasion characters. The goal was to build a [...]
1
u/best_codes Feb 10 '24
I do agree with the Bible (I'm a Christian). However, I do need to make it clear that:
Curses in the Bible are not profanity. They are demonic, like something a Lucifer worshiper would do.
Whether or not someone allows teachings about Satan on their website is up to them. The website is their property, after all.
As for my personal beliefs, it would completely depend on the situation what I would do. I can't judge what I would do in every scenario for fear of making a hasty generalization.
Most likely, however, because of my religious beliefs, I would feel compelled to remove such content from my website (as my website is a coding portfolio and such comments would be quite irrelevant).
In the same way that I own my physical property (land) and could trespass someone for saying the word 'cat' on my land, I may also choose to remove content from my website as I please. I hope this is clear.
Let me know if you have any other questions!