MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / run

Method run

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

Source from the content-addressed store, hash-verified

554 return not block or block.startswith('\n')
555
556 def run(self, parent: etree.Element, blocks: list[str]) -> None:
557 block = blocks.pop(0)
558 filler = '\n\n'
559 if block:
560 # Starts with empty line
561 # Only replace a single line.
562 filler = '\n'
563 # Save the rest for later.
564 theRest = block[1:]
565 if theRest:
566 # Add remaining lines to master blocks for later.
567 blocks.insert(0, theRest)
568 sibling = self.lastChild(parent)
569 if (sibling is not None and sibling.tag == 'pre' and
570 len(sibling) and sibling[0].tag == 'code'):
571 # Last block is a code block. Append to preserve whitespace.
572 sibling[0].text = util.AtomicString(
573 '{}{}'.format(sibling[0].text, filler)
574 )
575
576
577class ReferenceProcessor(BlockProcessor):

Callers

nothing calls this directly

Calls 1

lastChildMethod · 0.80

Tested by

no test coverage detected