Skip to content

Impossible to combine ~ and ! in a cross-reference #14581

Description

@parulin

Describe the bug

You can't combine ~ and ! in a cross-reference

How to Reproduce

:py:func:`!~any.thing`

Will output ~any.thing()

:py:func:`~!any.thing`

Will output thing(), the expected behavior but a warning is raised

Environment Information

Platform:              linux; (Linux-6.18.35-1.qubes.fc41.x86_64-x86_64-with-glibc2.41)
Python version:        3.13.5 (main, Jun 13 2026, 14:18:01) [GCC 14.2.0])
Python implementation: CPython
Sphinx version:        9.1.0
Docutils version:      0.22.4
Jinja2 version:        3.1.6
Pygments version:      2.20.0

Sphinx extensions

none

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions