Skip to content

Releases: oe/truncate-html

Fix Cheerio's break changes

15 Aug 17:36
@oe oe
Compare
Choose a tag to compare

Cheerio released stable v1.0 a few days ago, but its APIs are very different from the latest beta version 1.0.0-rc.12, which breaks this lib.

The v1.1.2 release has pinned the cheerio version to 1.0.0-rc.12 to fix the cheerio problem.

Reference:

  1. Cheerio 1.0 released, batteries included 🔋
  2. cheerio#4024, more issues about cheerio

Cheerio spent years on beta version of 1.0, and then bring so many break changes in stable version? Unbelievable!

update cheerio to v1.0.0-rc.12

02 Mar 15:12
@oe oe
8958596
Compare
Choose a tag to compare

There are several changes:

  1. no vulnerabilities
    CleanShot 2023-06-17 at 20 37 48
  2. cheerio can now handle CJK characters correctly
  3. if you are using custom cheerio instance with this library, you should set the third parameter of cheerio.load to false to get rid of extra wrappers, see load for details.
  4. better support for typescript

v1.0.0 has been released🎉

18 Mar 15:51
@oe oe
Compare
Choose a tag to compare

After a hard work, thanks to @calebeno v1.0.0 has been released

  1. added test cases, covered all statements/lines/branches, fixed some bugs, you can use truncate-html with faith
  2. added new option reserveLastWord to deal with when truncate in the middle of a word
  3. supports ES6 Modules, optimized for webpack/rollup
  4. upgraded cheerio to v0.22.0

Added test cases and `options.reserveLastWord`

03 Feb 16:46
@oe oe
Compare
Choose a tag to compare
  1. added test cases, covered all statements/lines/branches, fixed some bugs.
  2. added new option reserveLastWord to deal with when truncate in the middle of a word
  3. supports ES6 Modules, optimized for webpack/rollup

Thanks to @cenoicc 's help

truncating by words just supported

03 Mar 15:41
@oe oe
Compare
Choose a tag to compare

By setting option byWords to true, then option length means word count.

extra whitespaces can be reserved now

21 Jul 08:25
@oe oe
Compare
Choose a tag to compare

By setting option keepWhitespaces to true, you can keep the extra whitespaces when dealing with tags like pre.

By default continuous whitespace will be replaced to one space, setting keepWhitespaces to true can disable it.

fixed the issue when handing CJK characters

26 Nov 07:49
@oe oe
Compare
Choose a tag to compare