(self, parent: etree.Element, blocks: list[str])
| 531 | return False |
| 532 | |
| 533 | def run(self, parent: etree.Element, blocks: list[str]) -> None: |
| 534 | block = blocks.pop(0) |
| 535 | match = self.match |
| 536 | # Check for lines in block before `hr`. |
| 537 | prelines = block[:match.start()].rstrip('\n') |
| 538 | if prelines: |
| 539 | # Recursively parse lines before `hr` so they get parsed first. |
| 540 | self.parser.parseBlocks(parent, [prelines]) |
| 541 | # create hr |
| 542 | etree.SubElement(parent, 'hr') |
| 543 | # check for lines in block after `hr`. |
| 544 | postlines = block[match.end():].lstrip('\n') |
| 545 | if postlines: |
| 546 | # Add lines after `hr` to master blocks for later parsing. |
| 547 | blocks.insert(0, postlines) |
| 548 | |
| 549 | |
| 550 | class EmptyBlockProcessor(BlockProcessor): |
nothing calls this directly
no test coverage detected