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

Method run

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

Source from the content-addressed store, hash-verified

500 return bool(self.RE.match(block))
501
502 def run(self, parent: etree.Element, blocks: list[str]) -> None:
503 lines = blocks.pop(0).split('\n')
504 # Determine level. `=` is 1 and `-` is 2.
505 if lines[1].startswith('='):
506 level = 1
507 else:
508 level = 2
509 h = etree.SubElement(parent, 'h%d' % level)
510 h.text = lines[0].strip()
511 if len(lines) > 2:
512 # Block contains additional lines. Add to master blocks for later.
513 blocks.insert(0, '\n'.join(lines[2:]))
514
515
516class HRProcessor(BlockProcessor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected