[−][src]Crate lol_html
LOL HTML is a Low Output Latency streaming HTML rewriter/parser with CSS-selector based API.
It is designed to modify HTML on the fly with minimal buffering. It can quickly handle very large documents, and operate in environments with limited memory resources.
The crate serves as a back-end for the HTML rewriting functionality of Cloudflare Workers, but can be used as a standalone library with the convenient API for a wide variety of HTML rewriting/analyzis tasks.
The crate provides two main API entry points:
HtmlRewriter
- a streaming HTML rewriter;rewrite_str
- one-off HTML string rewriting function.
Modules
errors | The errors that can be produced by the crate's API. |
html_content | HTML content descriptors that can be produced and modified by a rewriter. |
Macros
comments | A convenience macro to construct a rewriting handler for HTML comments in the inner content of an element that can be matched by the specified CSS selector. |
doc_comments | A convenience macro to construct a rewriting handler for all HTML comments in the HTML document. |
doc_text | A convenience macro to construct a rewriting handler for all text chunks in the HTML document. |
doctype | A convenience macro to construct a handler for document type declarations in the HTML document. |
element | A convenience macro to construct a rewriting handler for elements that can be matched by the specified CSS selector. |
text | A convenience macro to construct a rewriting handler for text chunks in the inner content of an element that can be matched by the specified CSS selector. |
Structs
DocumentContentHandlers | Specifies document-level content handlers. |
ElementContentHandlers | Specifies element content handlers associated with a selector. |
HtmlRewriter | A streaming HTML rewriter. |
MemorySettings | Specifies the memory settings for |
RewriteStrSettings | Specifies settings for the |
Selector | Parsed CSS selector. |
Settings | Specifies settings for |
Traits
OutputSink | Defines an interface for the |
Functions
rewrite_str | Rewrites given |