HTML5 Zone is brought to you in partnership with:

Hirvesh Munogee is a freelance web developer who also happens to have a passion for blogging. Hirvesh is a DZone MVB and is not an employee of DZone and has posted 177 posts at DZone. You can read more from them at their website. View Full User Profile

Cutter.js - A Library For Truncating HTML Code By Word Number Without Losing Markup

12.21.2012
| 3042 views |
  • submit to reddit

Cutter.js is a library used for truncating HTML code to limit its length, by word number, without losing the markup.  Cutter solves the problem when its needed to cut some content by a number of words but its mandatory no lose any markup. Cutter cuts the content to the number of requested words and if needed puts a link to open the full content again.

Features

  • No markup is lost.
  • Framework agnostic.
  • The content can be written without take care about the full content.
  • Not needed to have two different contents.

 

Browser Support

  • IE >= 6
  • Firefox >= 3
  • Safari >= 4
  • Google Chrome >= 4
  • Opera >= 9.5

Requirements: None
Demo:http:/ / tcorral. github. com/ Cutter. js/ #examples
License: MIT License



Published at DZone with permission of Hirvesh Munogee, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)