Tilde character in Mermaid diagram syntax is causing an error #3242
Zak Siddiqui opened 2 days ago

There's an issue in displaying Mermaid diagrams in Markdown where the double tilde character ~~ is being interpreted as a <del> symbol in markdown.

This character, when entered three times ~~~, represents a special layout in Mermaid diagrams where the elements should be forced to be laid out one on top of the other (in a top-to-bottom diagram). It is a necessary part of Mermaid syntax.

In a mermaid diagram, the tilde character should not be interpreted as a delete symbol.

However, OneDev is trying to interpret it as a strikethrough. I'm not sure if this is an issue with the Markdown engine or the Mermaid engine.

Or a bug in the combination of the way that both work together.

Suspected reason for the bug

It's almost as if OneDev is escaping the syntax before sending it to the Mermaid engine, in a way that should not be done.

Or perhaps it's doing some interpretation first and transforming the syntax before sending it to the Mermaid engine.

Mermaid diagram source

flowchart TD
    LC["Current — removed or replaced"]:::current
    LP["Proposed — added by this fix"]:::proposed
    LM["Common — unchanged"]:::common
    LC ~~~ LP ~~~ LM

What is expected to be displayed?

image.png

The error message: what is being displayed?

Parse error on line 5:
...d"]:::common    LC <del>~ LP </del>~ LM
----------------------^
Expecting 'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'AMP', 'COLON', 'START_LINK', 'LINK', 'LINK_ID', 'DOWN', 'DEFAULT', 'NUM', 'COMMA', 'NODE_STRING', 'BRKT', 'MINUS', 'MULT', 'UNICODE_TEXT', got 'TAGSTART'
  • Zak Siddiqui changed fields 1 day ago
    Name Previous Value Current Value
    Priority
    Normal
    Major
  • Zak Siddiqui commented 1 day ago

    Moving this to Major because it involves significant effort to refactor the diagrams, and this is taking up more work.(On top of that, we lose the ability to easily understand the diagrams when we can't use this syntax.)

    We use diagrams very heavily, and to refactor every single diagram manually or using an AI prompt is becoming quite detrimental to our productivity.

1/1
Type
Bug
Priority
Major
Assignee
Affected Versions
OneDev 17.1.2
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-3242
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover