MCPcopy
hub / github.com/Python-Markdown/markdown / run

Method run

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

Source from the content-addressed store, hash-verified

531 return False
532
533 def run(self, parent: etree.Element, blocks: list[str]) -> None:
534 block = blocks.pop(0)
535 match = self.match
536 # Check for lines in block before `hr`.
537 prelines = block[:match.start()].rstrip('\n')
538 if prelines:
539 # Recursively parse lines before `hr` so they get parsed first.
540 self.parser.parseBlocks(parent, [prelines])
541 # create hr
542 etree.SubElement(parent, 'hr')
543 # check for lines in block after `hr`.
544 postlines = block[match.end():].lstrip('\n')
545 if postlines:
546 # Add lines after `hr` to master blocks for later parsing.
547 blocks.insert(0, postlines)
548
549
550class EmptyBlockProcessor(BlockProcessor):

Callers

nothing calls this directly

Calls 1

parseBlocksMethod · 0.80

Tested by

no test coverage detected