Skip to content

Commit 4e6acf8

Browse files
Fix the README syntax, because I did terrible.
1 parent e7c3098 commit 4e6acf8

1 file changed

Lines changed: 43 additions & 23 deletions

File tree

README.md

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,20 @@ CensorCore is a lightweight JavaScript library for detecting explicit, harmful,
77

88
Version 2.0 introduces a more advanced moderation engine with phrase detection, severity levels, async loading events, and a detailed `analyze()` API, while remaining fully backward‑compatible with the original `isBlocked()` function. CensorCore is suitable for chat applications, comment systems, forms, or any environment where user‑generated text requires screening.
99

10-
Features
10+
## Features
1111

12-
- Zero‑configuration setup - Shared JSON wordlist loaded from CDN - Phrase detection (supports multi‑word entries) - Automatic severity mapping based on category - Minimal and predictable API (isBlocked + analyze) - Async lifecycle events (onReady, onError) - Optional custom rule extension - No DOM modification or event interception - Full control retained by the integrating developer
1312

14-
Installation
13+
- Zero‑configuration setup
14+
- Shared JSON wordlist loaded from CDN
15+
- Phrase detection (supports multi‑word entries)
16+
- Automatic severity mapping based on category
17+
- Minimal and predictable API (isBlocked + analyze)
18+
- Async lifecycle events (onReady, onError)
19+
- Optional custom rule extension
20+
- No DOM modification or event interception
21+
- Full control retained by the integrating developer
22+
23+
## Installation
1524

1625
To install CensorCore, include the script tag in the `<head>` of your HTML file to ensure it loads before your application code runs:
1726

@@ -30,7 +39,7 @@ Make sure your internet connection allows loading scripts from the CDN at:
3039

3140
https://cdn.jsdelivr.net
3241

33-
Basic Integration
42+
## Basic Integration
3443

3544
Inside your message‑sending logic, add this check:
3645

@@ -66,7 +75,7 @@ function sendMessage() {
6675
6776
```
6877

69-
Advanced Usage (Version 2.0)
78+
## Advanced Usage (Version 2.0)
7079

7180
Use the new `analyze()` API for detailed moderation results:
7281

@@ -83,7 +92,7 @@ if (result.blocked) {
8392
8493
```
8594

86-
Custom Rules
95+
## Custom Rules
8796

8897
You can add your own rules without modifying the main wordlist:
8998

@@ -96,37 +105,48 @@ censor.extend([
96105
97106
```
98107

99-
Wordlist Structure
108+
## Wordlist Structure
100109

101110
CensorCore loads a JSON file structured by category. Your actual wordlist includes categories such as:
102111

103-
profanity hate_speech harassment sexual_content violence self_harm drugs weapons extremism terrorism disallowed_phrases custom
112+
- profanity
113+
- hate_speech
114+
- harassment
115+
- sexual_content
116+
- violence
117+
- self_harm
118+
- drugs
119+
- weapons
120+
- extremism
121+
- terrorism
122+
- disallowed_phrases
123+
- custom
104124

105125
Each category is automatically assigned a severity level (low, medium, or high). All categories are merged into a single internal rule engine.
106126

107127
The CensorCore wordlist is curated solely by Derrick Richard to ensure consistency and quality. Community members cannot directly edit the wordlist. To request a new word or phrase, please use the Word Request section in the repository's Discussions page.
108128

109-
API Reference
129+
## API Reference
110130

111-
censor.isBlocked(text) Returns true if the text contains any blocked content.
131+
`censor.isBlocked(text)` - Returns true if the text contains any blocked content.
112132

113-
censor.analyze(text) Returns a detailed moderation result including: - whether the text is blocked - highest severity - category - all matched rules
133+
`censor.analyze(text)` Returns a detailed moderation result including: - whether the text is blocked - highest severity - category - all matched rules
114134

115-
censor.extend(rules) Adds custom moderation rules at runtime.
135+
`censor.extend(rules)` - Adds custom moderation rules at runtime.
116136

117-
censor.isReady() Returns true when the wordlist has finished loading.
137+
`censor.isReady()` - Returns true when the wordlist has finished loading.
118138

119-
censor.isFailed() Returns true if the wordlist failed to load.
139+
`censor.isFailed()` - Returns true if the wordlist failed to load.
120140

121-
censor.onReady(callback) Fires when the moderation engine is ready.
141+
`censor.onReady(callback)` - Fires when the moderation engine is ready.
122142

123-
censor.onError(callback) Fires if the moderation engine fails to load.
143+
`censor.onError(callback)` - Fires if the moderation engine fails to load.
124144

125-
Design Philosophy
145+
## Design Philosophy
126146

127147
CensorCore avoids modifying the DOM, intercepting events, or altering UI behavior. Instead, it provides a predictable, developer‑controlled moderation function. This ensures transparency, stability, and compatibility across a wide range of applications.
128148

129-
About the Developer
149+
## About the Developer
130150

131151
CensorCore was created and is maintained by Derrick Richard, a high school developer focused on building practical, lightweight tools for the web.
132152

@@ -136,14 +156,14 @@ More information about his work is available at: https://derrickrichard.github.i
136156

137157
The CensorCore wordlist is curated solely by Derrick Richard to ensure consistency and quality. Community members cannot directly edit the wordlist. To request a new word or phrase, please submit a request in the Word Request section of the repository's Discussions page.
138158

139-
Versions
159+
## Versions
140160

141-
v1.0.0 -- Initial release with basic filtering functionality and a basic JSON wordlist.
161+
v1.0.0 - Initial release with basic filtering functionality and a basic JSON wordlist.
142162

143-
v1.1.0 -- CensorCore v1.1.0 makes the filtering engine faster and more dependable. The wordlist is now processed ahead of time, the matching is quicker, and the library handles text in a more consistent way. The code has also been cleaned up so it is easier to follow and maintain. This update adds helper functions to check whether the wordlist has loaded or if something went wrong. The public API is locked to prevent accidental modification, and the library behaves more safely if used before loading finishes.
163+
v1.1.0 - CensorCore v1.1.0 makes the filtering engine faster and more dependable. The wordlist is now processed ahead of time, the matching is quicker, and the library handles text in a more consistent way. The code has also been cleaned up so it is easier to follow and maintain. This update adds helper functions to check whether the wordlist has loaded or if something went wrong. The public API is locked to prevent accidental modification, and the library behaves more safely if used before loading finishes.
144164

145-
v2.0.0 -- CensorCore v2.0.0 is a major upgrade that introduces phrase detection, automatic severity levels, async lifecycle events, a detailed analyze() API, and custom rule support. The internal rule engine has been redesigned for clarity and flexibility while remaining fully backward‑compatible with the original isBlocked() function.
165+
v2.0.0 - CensorCore v2.0.0 is a major upgrade that introduces phrase detection, automatic severity levels, async lifecycle events, a detailed analyze() API, and custom rule support. The internal rule engine has been redesigned for clarity and flexibility while remaining fully backward‑compatible with the original isBlocked() function.
146166

147-
License
167+
## License
148168

149169
This project is released under the MIT License.

0 commit comments

Comments
 (0)