HtmlSanitizeEx.Parser (html_sanitize_ex v1.5.0)

View Source

Summary

Functions

Parses a HTML string.

Types

html_tree()

@type html_tree() :: tuple() | list()

Functions

parse(html)

@spec parse(binary()) :: html_tree()

Parses a HTML string.

Examples

iex> HtmlSanitizeEx.Parser.parse("<div class=js-action>hello world</div>")
{"div", [{"class", "js-action"}], ["hello world"]}

iex> HtmlSanitizeEx.Parser.parse("<div>first</div><div>second</div>")
[{"div", [], ["first"]}, {"div", [], ["second"]}]

to_html(tokens)