whatisgithub

What 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

In one sentence

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

What do people build with it?

USE CASE 1

Sanitize user comments before rendering them on a message board.

USE CASE 2

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

USE CASE 3

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

USE CASE 4

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

What is it built with?

JavaScriptnpmBower

How does it compare?

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 get it running?

Difficulty · easy Time to first run · 5min

Copy-paste 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

What 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.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.