html-ellipsis
v2.0.14
Published
truncates a html string without messing up the tags
Downloads
6,595
Maintainers
Readme
html-ellipsis
Truncates a html string without messing up HTML tags
npm install --save html-ellipsis
Example
var ellipsis = require('html-ellipsis');
var text = 'Lorem <span class="ipsum"><b>ips<i>um</i></b></span>';
console.log(ellipsis(text, 11, true)); // Lorem <span class="ipsum"><b>ips<i>u</i></b></span>…
License
See LICENSE