Skip to content

Certain keywords inside Markdown links disappear when rendered #20139

@RosieTheGhostie

Description

@RosieTheGhostie

If certain Rust keywords are used as the first word in the square brackets of a Markdown link, the word will not render. This only seems to occur if the text inside the square brackets contains multiple words. These are the keywords I've found to trigger the bug:

  • const
  • enum
  • fn
  • macro (shown in MRE below)
  • mod
  • static
  • struct
  • trait
  • type
  • union

rust-analyzer version: 0.3.2519-standalone (6df1213 2025-06-29)

rustc version: 1.85.0 (4d91de4e4 2025-02-17)

editor or extension: VSCode (extension v0.3.2519)

relevant settings: AFAIK, none of my documentation-related settings have been tampered with.

code snippet to reproduce:

enum Foo {
    MacroExpansion,
}

/// I return a [macro expansion](Foo::MacroExpansion).
fn bar() -> Foo {
    Foo::MacroExpansion
}

Image

Edit: I accidentally left the union keyword in my screenshot from when I was testing keywords.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions