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

Method run

markdown/blockprocessors.py:513–524  ·  view source on GitHub ↗
(self, parent: etree.Element, blocks: list[str])

Source from the content-addressed store, hash-verified

511 return bool(self.RE.match(block))
512
513 def run(self, parent: etree.Element, blocks: list[str]) -> None:
514 lines = blocks.pop(0).split('\n', 2)
515 # Determine level. `=` is 1 and `-` is 2.
516 if lines[1].startswith('='):
517 level = 1
518 else:
519 level = 2
520 h = etree.SubElement(parent, 'h%d' % level)
521 h.text = lines[0].strip()
522 if len(lines) > 2:
523 # Block contains additional lines. Add to master blocks for later.
524 blocks.insert(0, lines[2])
525
526
527class HRProcessor(BlockProcessor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected