text-clipper gains ability to strip tags in 2.2.0 release


text-clipper is a library for truncating text, both plain text and HTML. With the new 2.2 release, it gained a powerful new ability: stripping tags from HTML input.


const clipped = clip(
    “<p>Hello <img alt=‘Beautiful’ src=‘#’> World, everyone!</p>”,
    { html: true, stripTags: [“img”] }
// clipped == “<p>Hello  World, …</p>”

Author: Shantun Parmar

Leave a Reply

Your email address will not be published.