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

Text is not rendered in nodes of flowchart with several commas #5787

Closed
InAnYan opened this issue Aug 28, 2024 · 6 comments · Fixed by #5856
Closed

Text is not rendered in nodes of flowchart with several commas #5787

InAnYan opened this issue Aug 28, 2024 · 6 comments · Fixed by #5856
Labels
Area: Development Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@InAnYan
Copy link

InAnYan commented Aug 28, 2024

Description

When I wrote a node with text in double quotes with several commas, the text is not rendered inside a node.

Steps to reproduce

  1. Run code sample

Screenshots

image

Code Sample

flowchart TB
    githost["Github, Gitlab, BitBucket, etc."]

Setup

  • Mermaid version: 11.0.2
  • Browser and Version: Firefox

Suggested Solutions

No response

Additional Context

No response

@InAnYan InAnYan added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Aug 28, 2024
@InAnYan
Copy link
Author

InAnYan commented Aug 28, 2024

It seems this also breaks if I replace commas with semicolons

@InAnYan
Copy link
Author

InAnYan commented Aug 28, 2024

Updating:

When you use special characters like comma, dot (dot is new), semicolon, and you type them more than once, the rendering breaks.

A single special character is fine

@sidharthv96 sidharthv96 added Status: Approved Is ready to be worked on Area: Development and removed Status: Triage Needs to be verified, categorized, etc labels Aug 29, 2024
@jgreywolf
Copy link
Contributor

I believe that this may be a firefox only issue

@dolt
Copy link

dolt commented Aug 29, 2024

It's appears to be a Firefox issue and it isn't the number of commas, it fails to render the text if it's long enough to wrap.

flowchart TB
    example["This text is too long by one."]

When it doesn't render:

<foreignObject height="0" width="0">

When it does render:

<foreignObject height="24" width="197.43333435058594">

Using the config to not use foreignObject renders the text correctly: #2688 (comment)

@dolt
Copy link

dolt commented Aug 29, 2024

As a mitigation you can conditionally disable htmlLabels for Firefox user-agents.

    flowchart: {
        htmlLabels: !navigator.userAgent.includes('Firefox'), // text long enough to wrap is not rendering in Firefox
    },

@dolt
Copy link

dolt commented Aug 30, 2024

This issue looks to be a duplicate of #5785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Development Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants