This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Web: add mermaid diagram rendering#62678
Merged
Merged
Conversation
b0dfb82 to
25433d0
Compare
camdencheek
commented
May 15, 2024
|
|
||
| var ( | ||
| chromaOnly = regexp.MustCompile(`^(?:chroma-[a-zA-Z0-9\-]+)|chroma$`) | ||
| chromaOnly = regexp.MustCompile(`^(?:chroma-[a-zA-Z0-9\-]+)|chroma|language-[a-zA-Z]+$`) |
Member
Author
There was a problem hiding this comment.
GoldMark already adds a class="language-mermaid", but we were stripping that during sanitization
Contributor
peterguy
approved these changes
May 15, 2024
peterguy
left a comment
Contributor
There was a problem hiding this comment.
The render in dark mode isn't great (see previous comment for screenshot), but this otherwise looks a-ok!
Member
Author
|
@peterguy good catch on dark mode! I updated the PR to also support dark mode (at least somewhat). It doesn't live-update when the theme changes because that would take a bit more work to manually specify the theme, but it does at least use the theme you have configured. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds rendering for mermaid diagrams to the web app (both React and Svelte). We do not do this on the backend because mermaid is a JS library. This was not planned work, but it's been requested enough and is easy enough that I figured it was worth a couple hours to slot it in.
Related Slack thread
Test plan
Manual testing. See demo video.