Stop escaping special characters in mermaid tooltips#109
Merged
Conversation
abb38bb to
0027817
Compare
Collaborator
Author
|
Note Rob Purvis (@mo-robert-purvis) that if you want to play with this yourself you need not change the src of the js file. Simply open one of the test result files within dagrunner with your browser: You will notice that all files generated by the dagrunner tests, reference the relative web component path rather than than the remotely hosted one. |
Rob Purvis (mo-robert-purvis)
approved these changes
Jun 24, 2026
Rob Purvis (mo-robert-purvis)
left a comment
Contributor
There was a problem hiding this comment.
Looks good - tooltips fixed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Something I had been meaning to get to in quite some time.
<br>tags aren't being recognized as newlines in Mermaid tooltips when used within my custom web component (mermaid-table-standard.js), even though they normally work in standard Mermaid diagrams.Web components often escape special characters (like
<,>, and/) by default when interpolating values into templates.<br>may then be rendered as plain text (<br>) instead of being interpreted as an HTML line break.Added MutationObserver-based rebinding so this keeps working across Mermaid re-renders/theme toggles.
Test
Before change:
After change: