(self, parent: etree.Element, blocks: list[str])
| 542 | return False |
| 543 | |
| 544 | def run(self, parent: etree.Element, blocks: list[str]) -> None: |
| 545 | block = blocks.pop(0) |
| 546 | match = self.match |
| 547 | # Check for lines in block before `hr`. |
| 548 | prelines = block[:match.start()].rstrip('\n') |
| 549 | if prelines: |
| 550 | # Recursively parse lines before `hr` so they get parsed first. |
| 551 | self.parser.parseBlocks(parent, [prelines]) |
| 552 | # create hr |
| 553 | etree.SubElement(parent, 'hr') |
| 554 | # check for lines in block after `hr`. |
| 555 | postlines = block[match.end():].lstrip('\n') |
| 556 | if postlines: |
| 557 | # Add lines after `hr` to master blocks for later parsing. |
| 558 | blocks.insert(0, postlines) |
| 559 | |
| 560 | |
| 561 | class EmptyBlockProcessor(BlockProcessor): |
nothing calls this directly
no test coverage detected