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

Hex colors in linkStyle generate unicode errors #757

Open
Matt343 opened this issue Oct 2, 2024 · 0 comments
Open

Hex colors in linkStyle generate unicode errors #757

Matt343 opened this issue Oct 2, 2024 · 0 comments

Comments

@Matt343
Copy link

Matt343 commented Oct 2, 2024

Describe the bug
When including a color:#ff0000 link style in a flowchart diagram, the mermaid CLI throws an error after trying to parse the color value as unicode.

To Reproduce
Steps to reproduce the behavior:

test.mmd:

flowchart LR
A --> B
linkStyle 0 stroke-width:3px,color:#00ccff;
$ mmdc -i test.mmd                                                                                                   !8175
Generating single mermaid chart

Error: Parse error on line 3:
...oke-width:3px,color:fl°00ccff¶ß
-----------------------^
Expecting 'SEMI', 'NEWLINE', 'SPACE', 'EOF', 'COLON', 'STYLE', 'NUM', 'COMMA', 'NODE_STRING', 'UNIT', 'BRKT', 'PCT', got 'UNICODE_TEXT'
Parser3.parseError (/Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/mermaid/dist/mermaid.js:50583:28)
    at #evaluate (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:383:19)
    at async ExecutionContext.evaluate (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:270:16)
    at async IsolatedWorld.evaluate (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/IsolatedWorld.js:97:16)
    at async CdpJSHandle.evaluate (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/api/JSHandle.js:139:20)
    at async CdpElementHandle.evaluate (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/api/ElementHandle.js:334:20)
    at async CdpElementHandle.$eval (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/api/ElementHandle.js:488:24)
    at async CdpFrame.$eval (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/api/Frame.js:441:20)
    at async CdpPage.$eval (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:443:20)
    at async renderMermaid (file:///Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/src/index.js:250:22)
    at fromText (/Users/mattallen/.nvm/versions/node/v20.17.0/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/mermaid/dist/mermaid.js:140237:21)

Expected behavior
The hex code should be added to the css, not interpreted as a unicode literal

Desktop (please complete the following information):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant