parse_blocks

Function parse_blocks 

Source
pub fn parse_blocks(markdown: &str) -> Vec<ContentBlock>
Expand description

Parse markdown content into structured blocks.

This is the main entry point for block-level parsing. It handles:

  • Wikilink preprocessing (converts [[x]] to markdown links)
  • HTML details block extraction
  • Full pulldown-cmark parsing with GFM extensions

ยงExample

use turbovault_parser::parse_blocks;
use turbovault_core::ContentBlock;

let markdown = "# Hello World\n\nThis is a **paragraph** with *inline* formatting.";

let blocks = parse_blocks(markdown);
assert!(matches!(blocks[0], ContentBlock::Heading { level: 1, .. }));