Skip to main content

MAX_DEPTH

Constant MAX_DEPTH 

Source
pub const MAX_DEPTH: u32 = 1024;
Expand description

Maximum depth of element nesting accepted by the parser.

Adversarial documents with thousands of nested tags would otherwise let recursive tree walks (validation, serialization, selector matching) blow the stack. The limit is intentionally generous for hand-authored markdown while staying well below the default Rust stack size.