Initialize the block parser. Arguments: md: A Markdown instance. Attributes: BlockParser.md (Markdown): A Markdown instance. BlockParser.state (State): Tracks the nesting level of current location in document being parsed. BlockParse
(self, md: Markdown)
| 81 | """ |
| 82 | |
| 83 | def __init__(self, md: Markdown): |
| 84 | """ Initialize the block parser. |
| 85 | |
| 86 | Arguments: |
| 87 | md: A Markdown instance. |
| 88 | |
| 89 | Attributes: |
| 90 | BlockParser.md (Markdown): A Markdown instance. |
| 91 | BlockParser.state (State): Tracks the nesting level of current location in document being parsed. |
| 92 | BlockParser.blockprocessors (util.Registry): A collection of |
| 93 | [`blockprocessors`][markdown.blockprocessors]. |
| 94 | |
| 95 | """ |
| 96 | self.blockprocessors: util.Registry[BlockProcessor] = util.Registry() |
| 97 | self.state = State() |
| 98 | self.md = md |
| 99 | |
| 100 | def parseDocument(self, lines: Iterable[str]) -> etree.ElementTree: |
| 101 | """ Parse a Markdown document into an `ElementTree`. |