html-ellipsis
TypeScript icon, indicating that this package has built-in type declarations

2.0.8 • Public • Published

html-ellipsis

NPM Test semantic-release: angular npm npm

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>&hellip;

License

See LICENSE

Package Sidebar

Install

npm i html-ellipsis

Weekly Downloads

1,247

Version

2.0.8

License

MIT

Unpacked Size

53.6 kB

Total Files

24

Last publish

Collaborators

  • alexghr