(self, parent: etree.Element, blocks: list[str])
| 511 | return bool(self.RE.match(block)) |
| 512 | |
| 513 | def run(self, parent: etree.Element, blocks: list[str]) -> None: |
| 514 | lines = blocks.pop(0).split('\n', 2) |
| 515 | # Determine level. `=` is 1 and `-` is 2. |
| 516 | if lines[1].startswith('='): |
| 517 | level = 1 |
| 518 | else: |
| 519 | level = 2 |
| 520 | h = etree.SubElement(parent, 'h%d' % level) |
| 521 | h.text = lines[0].strip() |
| 522 | if len(lines) > 2: |
| 523 | # Block contains additional lines. Add to master blocks for later. |
| 524 | blocks.insert(0, lines[2]) |
| 525 | |
| 526 | |
| 527 | class HRProcessor(BlockProcessor): |
nothing calls this directly
no outgoing calls
no test coverage detected