Skip to content

Link fixer fails to process cross-references in document body, causing malformed double-hash hrefs #123

@0kelvin0

Description

@0kelvin0

Problem

When using Sphinx Python domain cross-references (:py:obj:, :type:, etc.) in a SingleHTML build with SimplePDF, the generated hrefs contain malformed double-hash patterns like:
href="#document-api_reference/python_api/mypackage/index#mypackage.MyClass"
These links don't work in the browser and error like below is also shown during build:
ERROR: No anchor #document-api_reference/python_api/mypackage/abc/index#abc.def.ghi for internal URI reference

Expected Behavior

Hrefs should contain only the anchor:
href="#mypackage.MyClass"

Minimal Reproducible Example
RST source:
`.. py:class:: MyClass

Example class.

.. py:attribute:: config
:type: MyClass

References :py:obj:MyClass.`

Configuration
Sphinx: 8.2+
sphinx-simplepdf: 1.6.0
Extensions: sphinx-autoapi (generates API docs with :py:obj: references)
Multi-project documentation build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions