View Source Readability.Helper (readability v0.12.1)

Helpers for parsing, updating, and removing HTML tree.

Summary

Functions

Change existing tags by selector.

Normalizes and parses to HTML tree (tuple or list)) from binary HTML.

Remove html attributes

Removes tags.

Types

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

Functions

Link to this function

change_tag(content, selector, tag)

View Source
@spec change_tag(html_tree(), String.t(), String.t()) :: html_tree()

Change existing tags by selector.

Link to this function

normalize(raw_html, opts \\ [])

View Source
@spec normalize(binary(), list()) :: html_tree()

Normalizes and parses to HTML tree (tuple or list)) from binary HTML.

Link to this function

remove_attrs(content, t_attrs)

View Source
@spec remove_attrs(html_tree(), String.t() | [String.t()] | Regex.t()) :: html_tree()

Remove html attributes

Link to this function

remove_tag(content, fun)

View Source
@spec remove_tag(html_tree(), (... -> any())) :: html_tree()

Removes tags.