Tag-safe truncation for HTML and XML. Works by word!
npm install downsizeTag-safe HTML and XML text-truncation!
``sh`
npm install downsize
` some markup here...javascript`
downsize("
` some markuphtml`
` some markup here...javascript`
downsize("
` some mhtml`
` some markup here...javascript`
downsize("
` some m...html`
` Why, hello there! Hello again!javascript`
downsize("
` Why, hello there!html`
Downsize is designed to handle bad markup, and should count words and
characters accurately in spite of it. But it won't hold your hand.
It does close outstanding open tags for you, but leaves erroneous close-tags
for which the opening tag couldn't be found or was erroneously nested.
`sh``
npm test