html-ellipsis
v2.0.13
Published
truncates a html string without messing up the tags
Downloads
5,582
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