Skip to main content

process_custom_block_nodes

Function process_custom_block_nodes 

Source
pub fn process_custom_block_nodes<'a>(
    root: Node<'a>,
    config: &CustomBlockConfig,
)
Expand description

Walks the comrak AST and transforms HtmlBlock nodes that contain known custom block divs into styled alert HTML.

This is safer than regex on rendered HTML because it only touches nodes the parser explicitly identified as raw HTML blocks.