pub fn parse_without_annotation_attachment(
source: &str,
) -> Result<Document, String>Expand description
Parse a Lex document without running the annotation attachment stage.
This is useful for tests that need annotations to remain in the content tree rather than being attached as metadata. Common use cases:
- Testing annotation parsing in isolation
- Testing the attachment logic itself
- Element tests that expect annotations as content items
§Example
ⓘ
use crate::lex::testing::parse_without_annotation_attachment;
let source = ":: note ::\nSome paragraph\n";
let doc = parse_without_annotation_attachment(source).unwrap();
// Annotation is still in content tree, not attached as metadata
assert!(doc.root.children.iter().any(|item| matches!(item, ContentItem::Annotation(_))));