readability2 v0.3.0 Readability.Helper

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

Specs

html_tree() :: tuple() | list()

Link to this section Functions

Link to this function

candidate_tag?(html_tree)

Specs

candidate_tag?(html_tree()) :: boolean()

Check html_tree can be candidate or not.

Link to this function

change_tag(content, selector, tag)

Specs

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

Change existing tags by selector

Link to this function

normalize(raw_html, opts \\ [])

Specs

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)

Specs

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

Remove html attributes

Link to this function

remove_tag(content, fun)

Specs

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

Remove tags

Link to this function

text_length(html_tree)

Specs

text_length(html_tree()) :: number()

Count only text length