html_ellipsis 1.0.0 copy "html_ellipsis: ^1.0.0" to clipboard
html_ellipsis: ^1.0.0 copied to clipboard

A HTML ellipsis utility function for Dart

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>

You can also optionally add the ellipsis character.

String truncatedHtml = htmlEllsipsis('<div>Some cool example HTML</div>', 9, addEllipsis: true);
// <div>Some cool&hellip;</div>

Additional information #

This package is a Dart port of the awesome TypeScript library made by alexghr.

0
likes
150
pub points
20%
popularity

Publisher

unverified uploader

A HTML ellipsis utility function for Dart

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on html_ellipsis