nodejs-html-truncate
nodejs-html-truncate copied to clipboard
Problem handling entities
I'm seeing problems with properly entities, particularly with shorter strings. For example:
var truncate = require("html-truncate");
truncate( "<p>David & Jenny</p>", 13, { ellipsis: "" } );
returns "David & J"
truncate( "<p>D&C</p>", 4, { ellipsis: "" } );
returns "D&am"