/js-truncate-html

Truncate html content

Primary LanguageJavaScript

js-truncate-html

Truncate html content

Version

1.0.0

Examples

Pure Javascript Implementation

$ var truncater = new JsTruncateHtml({includeElipsis: true, elipsisLength: 5, elipsisCharacter: '-'});
$ truncater.truncate("Hello <b>World !!!</b>", 13);

Output: Hello World !

RequireJS Implementation

$ var MyTruncater = require('vendor/js-truncate-html/src/js-truncate-html');
$ MyTruncater.truncate("Hello <b>World !!!</b>", 13);

Output: Hello World !

License

MIT