Desktop,Mobile: Fixes #10785: Fix math is invisible in certain mermaid diagrams #10820
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.
Summary
The upgrade Mermaid to v10.9.1 included support for math expressions in mermaid diagrams.
Joplin renders Mermaid diagrams within
<pre>
s which havewhite-space: pre
by default. This breaks math expressions in certain diagrams. A previous commit partially fixed this for sequence diagrams (see comment). However, the change doesn't seem sufficient to fix the issue for all sequence diagrams (or perhaps even most? See #10785.).Resetting the
white-space
tounset
directly on the<pre>
, rather than on its direct<svg>
descendants seems to fix the issue for the sequence diagram provided in #10785.Fixes #10785.
Screenshot
Testing plan
This has been tested successfully on Ubuntu 24.04.