Skip to main content

collect_all_text

Function collect_all_text 

Source
pub fn collect_all_text<'a>(root: Node<'a>) -> String
Expand description

Recursively concatenates the plain-text content of a node’s subtree, stripping all Markdown and HTML markup. Blocks are separated by whitespace to prevent words from merging.

Captures both inline code (`foo`) and fenced code blocks — useful for search indexing where readers may query terms that only appear inside code samples.