diff --git a/src/mkdocs_autorefs/references.py b/src/mkdocs_autorefs/references.py index 59999c0..2fe1d6a 100644 --- a/src/mkdocs_autorefs/references.py +++ b/src/mkdocs_autorefs/references.py @@ -43,6 +43,8 @@ class AutoRefInlineProcessor(ReferenceInlineProcessor): """A Markdown extension.""" + name: str = "mkdocs-autorefs" + def __init__(self, *args: Any, **kwargs: Any) -> None: # noqa: D107 super().__init__(REFERENCE_RE, *args, **kwargs) @@ -224,6 +226,7 @@ def fix_refs(html: str, url_mapper: Callable[[str], str]) -> tuple[str, list[str class AnchorScannerTreeProcessor(Treeprocessor): """Tree processor to scan and register HTML anchors.""" + name: str = "mkdocs-autorefs-anchors-scanner" _htags: ClassVar[set[str]] = {"h1", "h2", "h3", "h4", "h5", "h6"} def __init__(self, plugin: AutorefsPlugin, md: Markdown | None = None) -> None: @@ -317,13 +320,13 @@ def extendMarkdown(self, md: Markdown) -> None: # noqa: N802 (casing: parent me """ md.inlinePatterns.register( AutoRefInlineProcessor(md), - "mkdocs-autorefs", + AutoRefInlineProcessor.name, priority=168, # Right after markdown.inlinepatterns.ReferenceInlineProcessor ) if self.plugin is not None and self.plugin.scan_toc and "attr_list" in md.treeprocessors: log.debug("Enabling Markdown anchors feature") md.treeprocessors.register( AnchorScannerTreeProcessor(self.plugin, md), - "mkdocs-autorefs-anchors-scanner", + AnchorScannerTreeProcessor.name, priority=0, )