gitwtfhub

wtf is html-janitor?

gaearon/html-janitor — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2016-02-08

2Audience · developerComplexity · 2/5DormantSetup · easy

TL;DR

HTML Janitor sanitizes user-submitted HTML by stripping any tags or attributes you didn't explicitly allow, protecting your app from malicious content.

Mindmap

mindmap
  root((repo))
    What it does
      Filters HTML content
      Strips unwanted tags
      Allowlist based
    Tech stack
      JavaScript
      npm and Bower
    Use cases
      Comment sanitization
      Rich text editors
      CMS input filtering
    Audience
      Web developers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Sanitize user comments before rendering them on a message board.

REASON 2

Filter pasted HTML in a rich text editor to strip out scripts and unsafe tags.

REASON 3

Allow only bold and italic formatting while blocking embedded links or scripts.

REASON 4

Protect a CMS from malicious HTML submitted through user-generated content.

What's in the stack?

JavaScriptnpmBower

How it stacks up

gaearon/html-janitor0-bingwu-0/live-interpreter0xkaz/llm-governance-dashboard
Stars222
LanguagePythonPython
Last pushed2016-02-08
MaintenanceDormant
Setup difficultyeasymoderatehard
Complexity2/52/54/5
Audiencedevelopergeneralops devops

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Yoink these prompts

Prompt 1
Show me how to configure HTML Janitor to allow only bold, italic, and links.
Prompt 2
Help me integrate HTML Janitor into a comment system to sanitize user input.
Prompt 3
Explain how this tool decides what HTML to strip versus keep.
Prompt 4
Show me how to use HTML Janitor in both a browser and a Node.js backend.

Frequently asked questions

wtf is html-janitor?

HTML Janitor sanitizes user-submitted HTML by stripping any tags or attributes you didn't explicitly allow, protecting your app from malicious content.

Is html-janitor actively maintained?

Dormant — no commits in 2+ years (last push 2016-02-08).

How hard is html-janitor to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is html-janitor for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.