Skip to main content

paragraph_sole_block_sentinel

Function paragraph_sole_block_sentinel 

Source
pub(crate) fn paragraph_sole_block_sentinel<'a>(
    node: &'a AstNode<'a>,
) -> Option<BlockSentinelKind>
Expand description

Allocation-free analogue of sole_block_sentinel that walks a comrak paragraph node directly.

Returns Some(kind) iff the paragraph’s body, taken across all Text-node descendants, contains exactly one block-sentinel codepoint and otherwise consists only of ASCII whitespace, AND the paragraph has no non-Text descendants (which would imply embedded inline structure incompatible with a sole-sentinel paragraph).