Currently we ignore identifiers that contain a space or a slash. This is problematic because object inventories allow spaces and slashes in object names. For example we find the following entry in Python's object inventory:
type hint std:term -1 glossary.html#term-type-hint -
Here type hint is the identifier that we would use to reference the glossary.html#term-type-hint page and anchor.
To Reproduce
In a MkDocs project, enable the mkdocstrings plugin, and load the Python objects inventory with std and py domains:
Description of the bug
Currently we ignore identifiers that contain a space or a slash. This is problematic because object inventories allow spaces and slashes in object names. For example we find the following entry in Python's object inventory:
Here
type hint
is the identifier that we would use to reference theglossary.html#term-type-hint
page and anchor.To Reproduce
In a MkDocs project, enable the mkdocstrings plugin, and load the Python objects inventory with
std
andpy
domains:Add the following cross-ref to your pages, observe that it isn't resolved and rendered:
Full traceback
/
Expected behavior
Cross-ref should be resolved.
Environment information
PYTHONPATH
:/home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/pep582
mkdocs-autorefs
v1.0.2.dev12+g57998bf.d20240820Additional context
Reported on Gitter/Matrix: https://matrix.to/#/!xiyyvEeLIRaWsNQixq:gitter.im/$3QyUA6E7tZIoO7azaDgjFDZ14KXVpcxaHp7Got6RkaQ?via=gitter.im&via=matrix.org