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

Method __init__

markdown/blockprocessors.py:349–358  ·  view source on GitHub ↗
(self, parser: BlockParser)

Source from the content-addressed store, hash-verified

347 """
348
349 def __init__(self, parser: BlockParser):
350 super().__init__(parser)
351 # Detect an item (`1. item`). `group(1)` contains contents of item.
352 self.RE = re.compile(r'^[ ]{0,%d}\d+\.[ ]+(.*)' % (self.tab_length - 1))
353 # Detect items on secondary lines. they can be of either list type.
354 self.CHILD_RE = re.compile(r'^[ ]{0,%d}((\d+\.)|[*+-])[ ]+(.*)' %
355 (self.tab_length - 1))
356 # Detect indented (nested) items of either type
357 self.INDENT_RE = re.compile(r'^[ ]{%d,%d}((\d+\.)|[*+-])[ ]+.*' %
358 (self.tab_length, self.tab_length * 2 - 1))
359
360 def test(self, parent: etree.Element, block: str) -> bool:
361 # As in `ListIndentProcessor`, nesting stops short of the recursion limit.

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected