Last updated:
0 purchases
html ellipsis
Truncates a HTML string to a maximum length and optionally adds an ellipsis while preserving the HTML structure.
Usage #
String truncatedHtml = htmlEllsipsis('<div>Some <strong>cool</strong> example HTML</div>', 9);
// <div>Some <strong>cool</strong></div>
copied to clipboard
You can also optionally add the ellipsis character.
String truncatedHtml = htmlEllsipsis('<div>Some cool example HTML</div>', 9, addEllipsis: true);
// <div>Some cool…</div>
copied to clipboard
Additional information #
This package is a Dart port of the awesome TypeScript library made by alexghr.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.