Skip to main content

clear_section_content

Function clear_section_content 

Source
pub fn clear_section_content(
    doc: &mut Document,
    section_id: &BlockId,
) -> Result<Vec<BlockId>>
Expand description

Clear all children of a section, preparing it for new content.

This removes all child blocks from the section, recursively deleting the entire subtree rooted at the section.

§Arguments

  • doc - The document to modify
  • section_id - The block ID of the section to clear

§Returns

  • Ok(Vec<BlockId>) - List of removed block IDs
  • Err(Error) - If the section doesn’t exist