MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / __init__

Method __init__

markdown/blockparser.py:83–98  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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`.

Callers

nothing calls this directly

Calls 1

StateClass · 0.85

Tested by

no test coverage detected