| 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. |