Expand description
Convenience re-exports of DOM helpers for post-processing extracted content.
These are a stable, curated subset of the internal utility library.
Functions§
- apply
- Apply
func(node, selector)to every descendant ofroot_nodethat matches any selector inselectors. Each selector’s matches are visited in reverse document order (safe for detach). Invalid CSS selectors are silently skipped. - contains_
single_ tag_ in_ element - Returns true if the passed node contains only single node that matches the tag_name, false otherwise
- move_
children - Move every child node of
from(in order) to be the last children ofto. After the call,fromhas no children. - normalize_
text - Collapse every run of two or more whitespace characters in
srcinto a single ASCII space. - replace_
relative_ urls_ with_ absolute - Rewrite all relative URLs in
<a>,<img>,<picture>,<figure>,<video>,<audio>, and<source>elements undernodeto absolute URLs usingdoc_uriand the optional<base href>path. - word_
count - Count the number of whitespace-delimited tokens in
text.