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

A robust, DOM-based HTML highlighting engine for Flutter. Supports complex HTML structures, cross-element selections, and persistent highlight anchoring.

Changelog #

1.0.0 - 2026-01-30 #

The First release of html_highlight is a simple and straightforward implementation. It includes the core HighlightEngine for applying highlights to HTML content, providing DOM-based parsing, idempotent application, and multiple strategies for resolving highlight positions such as DOM path, text position, and fuzzy matching. Highlights can span across different elements and there is text map caching for better performance. The HighlightAnchor data model supports both basic text position with context (V1) and precise DOM path positioning (V2) and is serializable to JSON for database storage. HighlightColor introduces eight standard highlight colors (yellow, green, blue, pink, orange, purple, red, cyan) and allows for custom hex colors. The HighlightResult type reports how many highlights were successfully applied and how many could not be resolved, and includes optional text mapping. The DomProcessor manages HTML-to-DOM conversion, strips highlights safely for repeat processing, extracts text with position data, and handles block elements. DomTextMap enables bidirectional mapping between plain text positions and DOM nodes, and supports both path tracking and range queries. NodePath provides a simple way to represent and resolve DOM node paths. HighlightApplicator uses all this to add highlights to single or multiple nodes, with special support for code blocks and links.

1
likes
160
points
118
downloads

Publisher

verified publishertheiskaa.com

Weekly Downloads

A robust, DOM-based HTML highlighting engine for Flutter. Supports complex HTML structures, cross-element selections, and persistent highlight anchoring.

Repository (GitHub)
View/report issues

Topics

#html #highlight #text-selection #dom #annotation

Documentation

Documentation
API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter, html

More

Packages that depend on html_highlight