Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

html-ellipsis

alexghr2.3kMIT2.0.16TypeScript support: included

truncates a html string without messing up the tags

truncate, html, ellipsis, ellipsize

readme

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

changelog

2.0.16 (2025-02-14)

2.0.15 (2025-02-14)

2.0.14 (2024-11-18)

2.0.13 (2024-11-04)

2.0.12 (2024-10-21)

2.0.11 (2024-08-26)

2.0.10 (2024-06-16)

2.0.9 (2024-06-10)

2.0.8 (2024-04-10)

2.0.7 (2024-02-21)

2.0.6 (2023-12-15)

2.0.5 (2022-11-07)

2.0.4 (2022-06-04)

2.0.3 (2022-06-02)

2.0.2 (2022-05-27)

2.0.1 (2022-01-03)

2.0.0 (2022-01-03)

Features

BREAKING CHANGES

  • new major version

Change Log

All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.

Unreleased

N/A

1.1.1 - 2015-11-08

Fixed

  • #2 - Consider pair of surrogates char points as single character.

1.1.0 - 2014-10-03

Added

  • Support for void tags (e.g. <br>, <img>).

1.0.0 - 2014-09-28

Initial version.