Expand description
Utility functions for detecting and handling code blocks and code spans in Markdown for rumdl.
Code block detection is delegated to pulldown-cmark, which correctly implements the CommonMark specification. This handles edge cases like:
- Backtick fences with backticks in the info string (invalid per spec)
- Nested fences (longer fence contains shorter fence as content)
- Mixed fence types (tilde fence contains backticks as content)
- Indented code blocks with proper list context handling
Structs§
- Code
Block Detail - Detailed information about a code block captured during parsing
- Code
Block Utils - Utility functions for detecting and handling code blocks in Markdown
- Colon
Definition Detail - A definition pulldown-cmark opens on a colon touching its text, together with the terms before it
- Definition
Text Detail - Text a definition holds directly, captured during parsing
- Parse
Result - Structure facts from document analysis, capturing data needed by individual rules.
- Stripped
Line - A line with its container prefixes removed (see
strip_enclosure). - Strong
Span Detail - A strong emphasis span captured during parsing
Enums§
- Code
Block Context - Classification of code blocks relative to list contexts
- Enclosure
- A container a fenced block sits in, with the extent the parser gave it.
Functions§
- continued_
depth - How many of the containers in
enclosing(outermost first)linecontinues: the longest prefix ofenclosingthatstrip_enclosureaccepts. - item_
runs - For each container in
enclosing, the number of consecutive items that start there. - strip_
enclosure - Remove the prefixes the containers in
enclosing(outermost first) put online, orNonewhen the line does not continue all of them.
Type Aliases§
- Line
ToList Map - Ordered list membership: maps line number (1-indexed) to list ID
- List
Start Values - Ordered list start values: maps list ID to the start value