Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 528 Bytes

README.md

File metadata and controls

12 lines (10 loc) · 528 Bytes

Build Status

A module to truncate strings containing HTML.

htmltruncate.truncate(str, target_len, ellipsis='')
Returns a copy of str truncated to target_len characters,
preserving HTML markup (which does not count towards the length).
Any tags that would be left open by truncation will be closed at
the end of the returned string.  Optionally append ellipsis if
the string was truncated.