Crate ruma_html

Source
Expand description

Opinionated HTML parsing and manipulating library.

Like the rest of the Ruma crates, this crate is primarily meant to be used for the Matrix protocol. It should be able to be used to interact with any HTML document but will offer APIs focused on specificities of HTML in the Matrix specification..

§Features

Modules§

matrixmatrix
Types to work with HTML elements and attributes suggested by the Matrix Specification.

Structs§

Attribute
A tag attribute, e.g. class="test" in <div class="test" ...>.
Children
An iterator through the children of a node.
ElementAttributesReplacement
The replacement of an element’s attributes.
ElementAttributesSchemes
An element’s attributes’ URI schemes.
ElementData
The data of an HTML element.
Html
An HTML fragment.
NameReplacement
The replacement of a name.
NodeRef
A reference to an HTML node.
PropertiesNames
A list of properties names for a parent.
QualName
A fully qualified name (with a namespace), used to depict names of tags and attributes.
SanitizerConfig
Configuration to sanitize HTML elements and attributes.

Enums§

HtmlSanitizerMode
What HTML elements and attributes should be kept by the sanitizer.
ListBehavior
The behavior of the setting.
NodeData
The data of a Node.
RemoveReplyFallback
Whether to remove the rich reply fallback while sanitizing.

Functions§

remove_html_reply_fallback
Remove the rich reply fallback of the given HTML string.
sanitize_html
Sanitize the given HTML string.

Type Aliases§

LocalName
Namespace
Prefix
StrTendril
Tendril for storing native Rust strings.