Skip to content

Javascript and php function to truncate/cut html-text and close opened tags.

Notifications You must be signed in to change notification settings

d3lity/js-truncate-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

js-truncate-html

Javascript function to truncate html-text and closing open tags. Short and sweet.

Usage:

  cut_html("<p><b>html-text seems hard to be truncated</b></p>",26);
  
  // ..and you'll get:
  
  "<p><b>html-text seems hard</b></p>..."

ToDO:

  • Make it only count text, now it also counts tag-characters
  • Remove html-comments before cutting

About

Javascript and php function to truncate/cut html-text and close opened tags.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published