刘凡 9ff4d1d109 add S3,archive,truncate há 2 anos atrás
..
.gitignore 9ff4d1d109 add S3,archive,truncate há 2 anos atrás
.travis.yml 9ff4d1d109 add S3,archive,truncate há 2 anos atrás
README.md 9ff4d1d109 add S3,archive,truncate há 2 anos atrás
htmltruncate.py 9ff4d1d109 add S3,archive,truncate há 2 anos atrás
setup.py 9ff4d1d109 add S3,archive,truncate há 2 anos atrás
tests.py 9ff4d1d109 add S3,archive,truncate há 2 anos atrás

README.md

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.