Skip to main content

walk_text_only_descendants

Function walk_text_only_descendants 

Source
fn walk_text_only_descendants<'a, F>(
    node: &'a AstNode<'a>,
    visit: &mut F,
) -> bool
where F: FnMut(&str) -> ControlFlow,
Expand description

Visit every Text descendant of node left-to-right. Returns true iff the entire subtree consists of Text leaves only (no Strong / Emph / Link / Code / etc. nodes), AND the visitor closure asked to continue at every step. Used to validate the “sole block sentinel paragraph” invariant cheaply.