Releases: oe/truncate-html
Releases · oe/truncate-html
update cheerio to v1.0.0-rc.12
There are several changes:
- no vulnerabilities
- cheerio can now handle CJK characters correctly
- if you are using custom cheerio instance with this library, you should set the third parameter of
cheerio.load
tofalse
to get rid of extra wrappers, see load for details. - better support for typescript
v1.0.0 has been released🎉
After a hard work, thanks to @calebeno v1.0.0
has been released
- added test cases, covered all statements/lines/branches, fixed some bugs, you can use truncate-html with faith
- added new option reserveLastWord to deal with when truncate in the middle of a word
- supports ES6 Modules, optimized for webpack/rollup
- upgraded
cheerio
tov0.22.0
Added test cases and `options.reserveLastWord`
- added test cases, covered all statements/lines/branches, fixed some bugs.
- added new option
reserveLastWord
to deal with when truncate in the middle of a word - supports ES6 Modules, optimized for webpack/rollup
Thanks to @cenoicc 's help
truncating by words just supported
By setting option byWords
to true
, then option length
means word count.
extra whitespaces can be reserved now
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.