Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Entity codes in a row not supported in flowchart #5153

Open
yoavst opened this issue Dec 19, 2023 · 2 comments
Open

Multiple Entity codes in a row not supported in flowchart #5153

yoavst opened this issue Dec 19, 2023 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@yoavst
Copy link
Contributor

yoavst commented Dec 19, 2023

Description

For flowcharts, multiple Entity codes in a row (or entity code and then a non-space character) seems to work in normal strings, but not in markdown strings.

Steps to reproduce

Normal strings:

flowchart TD
  N1(["#lt;#116;"])
flowchart TD
  N1(["#lt;t"])

both produce the expected behavior of the text "<t"

markdown strings

flowchart TD
  N1(["`#lt;#116;`"])
flowchart TD
  N1(["`#lt;t`"])

both produce empty text for the node

Setup

  • Mermaid version: 10.6.1 on mermaid.live
  • Browser and Version: Chrome 120
@yoavst yoavst added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Dec 19, 2023
@omer-priel
Copy link
Contributor

I found the problem, in the SVG it render <t as html so it try to create new html element and not the text "<t".
I will fix this

@omer-priel
Copy link
Contributor

omer-priel commented Dec 20, 2023

The function markdownToHTML("&lt;&gt;") return <p><></p> and not <p>&lt;&gt;</p>.
And markdownToHTML("#lt;#gt;") return <p><></p> and not <p>&lt;&gt;</p>.

This happens because the fromMarkdown function (belonging to the mdast-util-from-markdown library) converts the &lt; and #lt; to < and convert &gt; and #gt; to >.

@aloisklink what should be the behavior according to mermaid?

PS, I'm asking you (@aloisklink) because, I don't know how to ask the team of mermaid contributors in GitHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

2 participants