Skip to main content

for_each_text_descendant

Function for_each_text_descendant 

Source
pub(crate) fn for_each_text_descendant<'a, F>(node: &'a AstNode<'a>, visit: F)
where F: FnMut(&str),
Expand description

Visit every Text descendant of node left-to-right, calling visit on each &str slice. Unlike walk_text_only_descendants, this descends into emphasis / strong / link / code subtrees and ignores their wrappers — we only care about the leaf text. Used to count sentinels and peek the registry for paragraph-level dispatch.