github / markup

Determines which markup library to use to render a content file (e.g. README) on GitHub
MIT License
5.8k stars 3.41k forks source link

Mermaid diagrams with links do not render as anchors #1779

Closed james-async closed 2 months ago

james-async commented 3 months ago

At some point last week our Mermaid diagrams stopped rendering correctly.

Our Mermaid diagrams use single tick marks around the href tag value in the anchors upon the link text. My expectation is that our diagrams that use single or double tick marks around href attributes continue to render links upon the text between diagram elements.

The mermaid live editor example shows that this is valid syntax.

Examples

basic working, rendering diagram

Simple example renders fine with no anchors on the Text link text -- just as is expected.

flowchart LR
    A[Hard] -->|Text| B(Round)
    B --> C{Decision}
    C -->|One| D[Result 1]
    C -->|Two| E[Result 2]

Single tick marks

This example of the error scenario uses single tick marks around the href, the anchor text. Which is not what is expected. When this renders in a Wiki page or in this issue, the full href text is shown on the diagram Screenshot 2024-02-13 at 1 06 38 PM

flowchart LR
    A[Hard] -->|<a href='github.com'>Text<a>| B(Round)
    B --> C{Decision}
    C -->|One| D[Result 1]
    C -->|Two| E[Result 2]

double tick marks

This example of the error scenario does not even render the diagram.

flowchart LR
    A[Hard] -->|<a href="github.com">Text<a>| B(Round)
    B --> C{Decision}
    C -->|One| D[Result 1]
    C -->|Two| E[Result 2]

This example fails with an error Unable to render rich display Diagram error not found.. I've setup this issue such that if the problem is fixed, then just above, would render, but below is a screen shot of the error I am seeing. Screenshot 2024-02-13 at 12 59 51 PM

james-async commented 2 months ago

appears to be fixed 🤷