You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, trying to assign a hexadecimal color value to the last attribute of a linkStyle definition causes a parsing error. For example:
graph LR
A --> B
%% Assigning a hex color to the last attribute, parsing error
linkStyle 0 stroke-width:4px,stroke:#FF69B4;
graph LR
A --> B
linkStyle 0 stroke-width:4px,stroke:#FF69B4;
The parsing error does not occur when you assign a hex color value to an attribute that is not the last attribute, nor if you assign a color name instead of a hex value to the last attribute 🤯
graph LR
A --> B
C --> D
%% Assigning a hex color to an attribute that isn't the the last, works OK
linkStyle 0 stroke:#FF69B4,stroke-width:4px;
%% Assigning a color name instead of a hex value to the last attribute, works OK
linkStyle 1 stroke-width:4px,stroke:HotPink;
graph LR
A --> B
C --> D
linkStyle 0 stroke:#FF69B4,stroke-width:4px;
linkStyle 1 stroke-width:4px,stroke:HotPink;
Steps to reproduce
Recreate the graph definitions above in a mermaid compatible editor
View the rendered output
Observe the first graph generates a parsing error while the second does not
Chrome for OS X, Version 124.0.6367.93 (Official Build) (arm64)
Suggested Solutions
Based on the parsing error output, it appears to be an encoding problem while trying to parse the original hex value. I have verified that this is not a copy/paste issue from a corrupt source definition.
Parse error on line 4:
... linkStyle 0 stroke:fl°FF69B4¶ß
-----------------------^
Additional Context
No response
The text was updated successfully, but these errors were encountered:
chrisbloom7
changed the title
Parsing error when assigning a hex value to an attribute of linkStyle when it's the last attribute
Parsing error when assigning a hex color value to the last attribute of a linkStyle
May 2, 2024
Description
As the title says, trying to assign a hexadecimal color value to the last attribute of a
linkStyle
definition causes a parsing error. For example:The parsing error does not occur when you assign a hex color value to an attribute that is not the last attribute, nor if you assign a color name instead of a hex value to the last attribute 🤯
Steps to reproduce
Screenshots
Screenshot of the parsing error when rendered:
Code Sample
Setup
I've confirmed this behavior in both https://mermaid.live (as of
v10.9.0
) and https://develop.git.mermaid.live (as ofv11.0.0-alpha.7+e68125e
).Suggested Solutions
Based on the parsing error output, it appears to be an encoding problem while trying to parse the original hex value. I have verified that this is not a copy/paste issue from a corrupt source definition.
Additional Context
No response
The text was updated successfully, but these errors were encountered: