This changes the HTML tags used for auto-references from span to a custom autoref tag. This is made backward compatible by regex-replacing using both the old regex and the new one. The new regex is much, much simpler. Additional HTML attributes are parsed with a proper HTML parser, so ordering does not matter anymore.
Transition period:
A new mkdocs-autorefs version is released. It's backward compatible: mkdocstrings handlers (and any other project) will continue working as usual, even if they manually insert autorefs spans in their templates and/or docs.
A change is made in mkdocstrings-python (and other handlers) to support the new autoref HTML tag, setting AutorefsPlugin.legacy_refs to False to disable legacy refs (no perf loss). Handlers will require the new version of mkdocs-autorefs in their dependencies.
In the future, legacy refs are removed from mkdocs-autorefs, and handlers setting AutorefsPlugin.legacy_refs will be warned by type-checkers that this legacy_refs attribute does not exist anymore. At runtime, it will have no effect.
This changes the HTML tags used for auto-references from
span
to a customautoref
tag. This is made backward compatible by regex-replacing using both the old regex and the new one. The new regex is much, much simpler. Additional HTML attributes are parsed with a proper HTML parser, so ordering does not matter anymore.Transition period:
span
s in their templates and/or docs.autoref
HTML tag, settingAutorefsPlugin.legacy_refs
toFalse
to disable legacy refs (no perf loss). Handlers will require the new version of mkdocs-autorefs in their dependencies.AutorefsPlugin.legacy_refs
will be warned by type-checkers that thislegacy_refs
attribute does not exist anymore. At runtime, it will have no effect.