|
43 | 43 | class AutoRefInlineProcessor(ReferenceInlineProcessor):
|
44 | 44 | """A Markdown extension."""
|
45 | 45 |
|
| 46 | + name: str = "mkdocs-autorefs" |
| 47 | + |
46 | 48 | def __init__(self, *args: Any, **kwargs: Any) -> None: # noqa: D107
|
47 | 49 | super().__init__(REFERENCE_RE, *args, **kwargs)
|
48 | 50 |
|
@@ -224,6 +226,7 @@ def fix_refs(html: str, url_mapper: Callable[[str], str]) -> tuple[str, list[str
|
224 | 226 | class AnchorScannerTreeProcessor(Treeprocessor):
|
225 | 227 | """Tree processor to scan and register HTML anchors."""
|
226 | 228 |
|
| 229 | + name: str = "mkdocs-autorefs-anchors-scanner" |
227 | 230 | _htags: ClassVar[set[str]] = {"h1", "h2", "h3", "h4", "h5", "h6"}
|
228 | 231 |
|
229 | 232 | 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
|
317 | 320 | """
|
318 | 321 | md.inlinePatterns.register(
|
319 | 322 | AutoRefInlineProcessor(md),
|
320 |
| - "mkdocs-autorefs", |
| 323 | + AutoRefInlineProcessor.name, |
321 | 324 | priority=168, # Right after markdown.inlinepatterns.ReferenceInlineProcessor
|
322 | 325 | )
|
323 | 326 | if self.plugin is not None and self.plugin.scan_toc and "attr_list" in md.treeprocessors:
|
324 | 327 | log.debug("Enabling Markdown anchors feature")
|
325 | 328 | md.treeprocessors.register(
|
326 | 329 | AnchorScannerTreeProcessor(self.plugin, md),
|
327 |
| - "mkdocs-autorefs-anchors-scanner", |
| 330 | + AnchorScannerTreeProcessor.name, |
328 | 331 | priority=0,
|
329 | 332 | )
|
0 commit comments