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

Method run

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

Source from the content-addressed store, hash-verified

542 return False
543
544 def run(self, parent: etree.Element, blocks: list[str]) -> None:
545 block = blocks.pop(0)
546 match = self.match
547 # Check for lines in block before `hr`.
548 prelines = block[:match.start()].rstrip('\n')
549 if prelines:
550 # Recursively parse lines before `hr` so they get parsed first.
551 self.parser.parseBlocks(parent, [prelines])
552 # create hr
553 etree.SubElement(parent, 'hr')
554 # check for lines in block after `hr`.
555 postlines = block[match.end():].lstrip('\n')
556 if postlines:
557 # Add lines after `hr` to master blocks for later parsing.
558 blocks.insert(0, postlines)
559
560
561class EmptyBlockProcessor(BlockProcessor):

Callers

nothing calls this directly

Calls 1

parseBlocksMethod · 0.80

Tested by

no test coverage detected