• Home
  • Shave - A modern javascript plugin for truncating text within an html element

Shave - A modern javascript plugin for truncating text within an html element

Shave is a zero dependency javascript plugin that truncates multi-line text to fit within an html element based on a set max-height. It then stores the diff of the original text string in a hidden <span> element following the visible text.

This means the original text remains intact!


Source: https://dollarshaveclub.github.io/shave