Readability.Helper (readability2 v0.7.0)

Helpers for parsing, updating, removing html tree

Link to this section Summary

Functions

Check html_tree can be candidate or not.

Change existing tags by selector

Normalize and Parse to html tree(tuple or list)) from binary html

Remove html attributes

Count only text length

Link to this section Types

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

Link to this section Functions

Link to this function

candidate_tag?(html_tree)

@spec candidate_tag?(html_tree()) :: boolean()

Check html_tree can be candidate or not.

Link to this function

change_tag(content, selector, tag)

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

Change existing tags by selector

Link to this function

normalize(raw_html, opts \\ [])

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

Normalize and Parse to html tree(tuple or list)) from binary html

Link to this function

remove_attrs(content, t_attrs)

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

Remove html attributes

Link to this function

remove_tag(content, fun)

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

Remove tags

Link to this function

text_length(html_tree)

@spec text_length(html_tree()) :: number()

Count only text length