MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / run

Method run

markdown/blockprocessors.py:399–418  ·  view source on GitHub ↗
(self, parent, blocks)

Source from the content-addressed store, hash-verified

397 return bool(self.SEARCH_RE.search(block))
398
399 def run(self, parent, blocks):
400 lines = blocks.pop(0).split('\n')
401 prelines = []
402 # Check for lines in block before hr.
403 for line in lines:
404 m = self.MATCH_RE.match(line)
405 if m:
406 break
407 else:
408 prelines.append(line)
409 if len(prelines):
410 # Recursively parse lines before hr so they get parsed first.
411 self.parser.parseBlocks(parent, ['\n'.join(prelines)])
412 # create hr
413 hr = markdown.etree.SubElement(parent, 'hr')
414 # check for lines in block after hr.
415 lines = lines[len(prelines)+1:]
416 if len(lines):
417 # Add lines after hr to master blocks for later parsing.
418 blocks.insert(0, '\n'.join(lines))
419
420
421class EmptyBlockProcessor(BlockProcessor):

Callers

nothing calls this directly

Calls 6

parseBlocksMethod · 0.80
splitMethod · 0.45
popMethod · 0.45
matchMethod · 0.45
appendMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected