No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
Makefile
README.md
index.js
sanitizer.js
sanitizer.pegjs

README.md

SmallMlSanitizer

SmallMlSanitizer sanitizes user input to a small subset of html that is safe for embedding in html documents, xml documents and tsv files.

As far as possible it tries to preserve the user input.

The output format should match the validator.pegjs which is included in the SmallMlValidator project.

Compiling

No compiling is needed, and the precompiled grammar file is available as sanitizer.js.

There are no dependencies except for node.

Running

Command-line

$ echo '<i>invalid <b>string</i>'| node index.js
<i>invalid &lt;b&gt;string</i>

As a node module

var sanitizer = require('./sanitizer')
sanitizer.parse(txt)

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 only.