Text Sanitizer used by NTS in their Node.js applications. Sanitizes text blocks, including removal of HTML tags (excluding whitelisted tags) and transformation of Markdown into HTML.
Include as dependency in package.json
:
"text-sanitizer": "github:ntslive/text-sanitizer#0.0.4"
Note that this requires the Git tag 0.0.4
to be present.
Then run npm install
as usual.
const textSanitizer = require('text-sanitizer');
let plainTextName = textSanitizer.stripMarkdownTags(obj.name);
let descriptionHtml = textSanitizer.sanitizeText(obj.description);
let excerpt = textSanitizer.createExcerpt(obj.description);
Run npm test
To run eslint with fix
flag, run bin/eslint