Expand description
Parsing for Pandoc-style attributes: {#id .class key=value}
Attributes can appear after headings, fenced code blocks, fenced divs, etc. Syntax: {#identifier .class1 .class2 key1=val1 key2=“val2”}
Rules:
- Surrounded by { }
- Identifier: #id (optional, only first one counts)
- Classes: .class (can have multiple)
- Key-value pairs: key=value or key=“value” or key=‘value’ (can have multiple)
- Whitespace flexible between items
Structs§
Functions§
- emit_
attributes - Emit attribute block as AST nodes
- parse_
attribute_ content - Parse the content inside the attribute braces
- try_
parse_ trailing_ attributes - Try to parse an attribute block from the end of a string Returns: (attribute_block, text_before_attributes)
- try_
parse_ trailing_ attributes_ with_ pos - Try to parse an attribute block from the end of a string. Returns: (attribute_block, text_before_attributes, open_brace_position_in_trimmed_text)