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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove right padding when a label contains HTML entities #3222

Merged
merged 1 commit into from Aug 4, 2022

Conversation

leon19
Copy link

@leon19 leon19 commented Jul 12, 2022

馃搼 Summary

Decode the HTML entities from the label text before adding them to the
HTML this prevents a miss-calculation of the label text length

Example

stateDiagram-v2
[*] --> 1
1 --> 2: test({ foo#colon; 'far' })
2 --> [*]

Before

before

After

after

馃搹 Design Decisions

Not applicable

馃搵 Tasks

Make sure you

  • 馃摉 have read the contribution guidelines
  • 馃捇 have added unit/e2e tests (if appropriate)
  • 馃敄 targeted develop branch

Decode the HTML entities from the label text before adding them to the
HTML this prevents a miss-calculation of the label text length
@leon19 leon19 force-pushed the bugfix/incorrect-label-padding branch from 84bb186 to c40368b Compare July 26, 2022 19:58
@knsv knsv merged commit b0074bf into mermaid-js:develop Aug 4, 2022
@knsv
Copy link
Collaborator

knsv commented Aug 4, 2022

Thanks @leon19 !

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

Successfully merging this pull request may close these issues.

None yet

2 participants