Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Spaces and slashes not supported in autorefs identifiers #55

Closed
pawamoy opened this issue Aug 29, 2024 · 0 comments
Closed

bug: Spaces and slashes not supported in autorefs identifiers #55

pawamoy opened this issue Aug 29, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@pawamoy
Copy link
Member

pawamoy commented Aug 29, 2024

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:

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:

plugins:
- mkdocstrings:
    handlers:
      python:
        import:
        - url: https://docs.python.org/3/objects.inv
          domains: [std, py]

Add the following cross-ref to your pages, observe that it isn't resolved and rendered:

Link to [type hint][].

Full traceback

/

Expected behavior

Cross-ref should be resolved.

Environment information

python -m mkdocs_autorefs.debug  # | xclip -selection clipboard
  • System: Linux-6.10.6-arch1-1-x86_64-with-glibc2.40
  • Python: cpython 3.11.5 (/media/data/dev/mkdocs-autorefs/.venv/bin/python)
  • Environment variables:
    • PYTHONPATH: /home/pawamoy/.local/pipx/venvs/pdm/lib/python3.11/site-packages/pdm/pep582
  • Installed packages:
    • mkdocs-autorefs v1.0.2.dev12+g57998bf.d20240820

Additional context

Reported on Gitter/Matrix: https://matrix.to/#/!xiyyvEeLIRaWsNQixq:gitter.im/$3QyUA6E7tZIoO7azaDgjFDZ14KXVpcxaHp7Got6RkaQ?via=gitter.im&via=matrix.org

@pawamoy pawamoy added the unconfirmed This bug was not reproduced yet label Aug 29, 2024
@pawamoy pawamoy self-assigned this Aug 29, 2024
@pawamoy pawamoy added bug Something isn't working and removed unconfirmed This bug was not reproduced yet labels Aug 29, 2024
@pawamoy pawamoy closed this as completed Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant