Skip to content

Nested parse broken for button-ref but not button-link #228

Closed

Description

@larsoner

Describe the bug

context
In Sphinx-built docs, when I create a button-ref the nested parse is buggy, with button-link it's okay.

Not a minimal example, but in a make html of my site this reST:

.. card::
    :class-body: text-center
    :class-card: install-download-alert hidden

    .. We have to use a button-link here because button-ref doesn't properly nested parse the inline code

    .. button-link:: ./ides.html
        :ref-type: ref
        :color: success
        :shadow:
        :class: font-weight-bold mt-3
        :click-parent:

        |code| Go to IDE Setup

where |code| uses a fontawesome substitution via pydata-sphinx-theme, this generates something correct:

image

But when I change it to a .. button-ref: ide_setup (which is a valid link target and resolves to the same place) I get:

image

Not sure if this is related to #175 but it could be since that involves a nested parse.

Reproduce the bug

☝️

List your environment

Just installed sphinx-design from source on Linux Python 3.12.

Activity

  1. zerothi commented on Sep 9, 2025

    @zerothi

    Can confirm this with other direct link inserts:

    Wrong:

    .. button-ref:: workshops
       :ref-type: ref
       :outline:
       :shadow:
       :expand:
       :align: center
    
       **Workshops!**
    
        :far:`calendar` ...

    Correct:

    .. button-link:: ./workshops/index.html
       :ref-type: ref
       :outline:
       :shadow:
       :expand:
       :align: center
    
       **Workshops!**
    
        :far:`calendar` ...
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions