Skip to content

Text Sanitizer used by NTS in their Node applications.

Notifications You must be signed in to change notification settings

ntslive/text-sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeship Status for ntslive/text-sanitizer

NTS Text Sanitizer

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.

Installation

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.

Usage

const textSanitizer = require('text-sanitizer');
let plainTextName = textSanitizer.stripMarkdownTags(obj.name);
let descriptionHtml = textSanitizer.sanitizeText(obj.description);
let excerpt = textSanitizer.createExcerpt(obj.description);

Testing

Run npm test

To run eslint with fix flag, run bin/eslint

About

Text Sanitizer used by NTS in their Node applications.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •