Skip to content

Button role with no link shows as an empty button #2061

@choldgraf

Description

@choldgraf

When you use a button role, but don't give a link in addition to the text content, the displayed button has no text inside it. I think this is because, with no text given in the role, then it tries to interpret the role body as a reference and then if it doesn't resolve, the button is empty.

Intended behavior:

  • {button}`text` -> a button with "text" in the text and no link.
  • {button}`<text>` -> a button with "text" in the text, and that resolves to "text" w/ a link.
  • {button}`text<text2>` -> a button with "text" in the text, and that resolves to text2 w/ a link.

Example

For example see the images from this sandbox demo:

Image

Here's the AST of each.

Image

Why did I want to do this in the first place?

I wanted to highlight a GUI element, and this seemed like a better way of doing so than using {kbd}`hi`. In Sphinx, there was also a {guilabel} role, but I believe that this doesn't exist in MyST now, so I was trying to re-create that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions