| 520 | |
| 521 | |
| 522 | class _RawHTMLPreprocessor(markdown.preprocessors.Preprocessor): |
| 523 | def __init__(self) -> None: |
| 524 | super().__init__() |
| 525 | self.present_anchor_ids: set[str] = set() |
| 526 | |
| 527 | def run(self, lines: list[str]) -> list[str]: |
| 528 | parser = _HTMLHandler() |
| 529 | parser.feed('\n'.join(lines)) |
| 530 | parser.close() |
| 531 | self.present_anchor_ids = parser.present_anchor_ids |
| 532 | return lines |
| 533 | |
| 534 | def _register(self, md: markdown.Markdown) -> None: |
| 535 | md.preprocessors.register( |
| 536 | self, "mkdocs_raw_html", priority=21 # Right before 'html_block'. |
| 537 | ) |
| 538 | |
| 539 | |
| 540 | class _HTMLHandler(markdown.htmlparser.htmlparser.HTMLParser): # type: ignore[name-defined] |
no outgoing calls
no test coverage detected
searching dependent graphs…