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

Method test

markdown/blockprocessors.py:174–183  ·  view source on GitHub ↗
(self, parent: etree.Element, block: str)

Source from the content-addressed store, hash-verified

172 self.INDENT_RE = re.compile(r'^(([ ]{%s})+)' % self.tab_length)
173
174 def test(self, parent: etree.Element, block: str) -> bool:
175 # A list calls `parseBlocks` once per level of nesting, so the
176 # nesting has to stop short of the interpreter's limit. The markers which no
177 # longer nest are kept as text, as they are for a blockquote.
178 return block.startswith(' '*self.tab_length) and \
179 not self.parser.state.isstate('detabbed') and \
180 not util.nearing_recursion_limit() and \
181 (parent.tag in self.ITEM_TYPES or
182 (len(parent) and parent[-1] is not None and
183 (parent[-1].tag in self.LIST_TYPES)))
184
185 def run(self, parent: etree.Element, blocks: list[str]) -> None:
186 block = blocks.pop(0)

Callers

nothing calls this directly

Calls 1

isstateMethod · 0.80

Tested by

no test coverage detected