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

Method parseBlocks

markdown/blockparser.py:77–93  ·  view source on GitHub ↗

Process blocks of markdown text and attach to given etree node. Given a list of ``blocks``, each blockprocessor is stepped through until there are no blocks left. While an extension could potentially call this method directly, it's generally expected to be used int

(self, parent, blocks)

Source from the content-addressed store, hash-verified

75 self.parseBlocks(parent, text.split('\n\n'))
76
77 def parseBlocks(self, parent, blocks):
78 """ Process blocks of markdown text and attach to given etree node.
79
80 Given a list of ``blocks``, each blockprocessor is stepped through
81 until there are no blocks left. While an extension could potentially
82 call this method directly, it's generally expected to be used internally.
83
84 This is a public method as an extension may need to add/alter additional
85 BlockProcessors which call this method to recursively parse a nested
86 block.
87
88 """
89 while blocks:
90 for processor in list(self.blockprocessors.values()):
91 if processor.test(parent, blocks[0]):
92 processor.run(parent, blocks)
93 break
94
95

Callers 10

parseChunkMethod · 0.95
runMethod · 0.80
create_itemMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
create_itemMethod · 0.80
runMethod · 0.80

Calls 3

valuesMethod · 0.80
testMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected