-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text is not visible on Mermaid flowchart shapes with markdown string labels #27435
Comments
It seems mermaid relies on some CSS which we do not load. Should investigate how to extract this CSS from the mermaid package and then apply it inside the iframe. Example of missing CSS: blockquote, dd, dl, figure, h1, h2, h3, h4, h5, h6, hr, p, pre {
margin: 0;
} |
I could not find any CSS to load in the If they don't solve it, we would have to workaround and add these styles manually, likely by adding the base styles of tailwindcss because at least their demo page has that so it would be least likely to break in the future. |
Fixes: #27435 Related: mermaid-js/mermaid#4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
Fixes: go-gitea#27435 Related: mermaid-js/mermaid#4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
Fixes: go-gitea#27435 Related: mermaid-js/mermaid#4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
Backport #27503 to 1.21 Fixes: #27435 Related: mermaid-js/mermaid#4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
Backport #27503 to 1.20 Fixes: #27435 Related: mermaid-js/mermaid#4907 <img width="924" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/494a1d2e-4c56-48d0-9843-82a5e5aa977e">
Description
When I use the markdown string feature to format mermaid flowchart labels, the label position is off by a few pixels, so that most of the text is hidden.
Example:
https://try.gitea.io/terius/MermaidTest/src/branch/main/README.md
I guess this is due to mermaid uses
<p>
tag for markdown labels and gitea renders mermaid inside an<iframe>
. Seems like chrome adds some default margin to<p>
-tags inside iframes.There is an
iframeCss
const in mermaid.js. Adding a style to set margin to 0 for the iframe might fix the issue?Gitea Version
1.22.0+dev-101-g112f37c54
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Tested with try.gitea.io
Database
None
The text was updated successfully, but these errors were encountered: