nodejs-html-truncate icon indicating copy to clipboard operation
nodejs-html-truncate copied to clipboard

truncate html text and keep tag safe

Results 11 nodejs-html-truncate issues
Sort by recently updated
recently updated
newest added

Hi there! I started using this library some time ago and I've noticed that it is not truncating links. If I have a link, e.g. ``` SomeLongTextOfALinkEvenLongerThanThis ``` then this...

[This commit](https://github.com/huang47/nodejs-html-truncate/commit/e731334890ae07645d8b4963aca911896c0f0ce4) adds no value attributes to the truncation process but also introduces an infinite loop. Running this regex: KEY_VALUE_REGEX = '([\\w|-]+\\s*(=\\s*"[^"]*")?\\s*)*' on an iframe with attributes with and without...

I'm seeing problems with properly entities, particularly with shorter strings. For example: `var truncate = require("html-truncate");` `truncate( "David & Jenny", 13, { ellipsis: "" } );` returns "David & J"...

This code times a bunch of attribute keys: ```js const truncate = require('html-truncate'); function timeTruncate(html) { const start = Date.now(); truncate(html, 0); const end = Date.now(); console.log(`${end - start}ms for...

Thank you for a nice library. I've stumbled upon a bug the other day. I cannot figure out exactly when this happens, but I have an example: https://runkit.com/hofft/5877633764cddc00146690a8 ``` var...

it adds a closing tag at the end of the sentence and mess up the nodes.

``` javascript var trunc = require("html-truncate") trunc("ositooscuro", 8) ``` Results in: ``` 'osito

``` var t = require('html-truncate'); t('', 40); ``` ...returns ``` ``` ...rather than anything sensible. Moreover, increasing the requested length doesn't fix it (passing 1000 instead of 40) gives the...

I think this module should be converting html entities to chars before processing, so `&` should become `&` only then we could truncate. After executing the following: `truncate("FIFA Tournaments -...

This allows using single quotes e.g. `Google`.