Skip to content

Text is not visible on Mermaid flowchart shapes with markdown string labels #27435

Closed
@cy-x

Description

@cy-x

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

flowchart LR
TEST{{"`**Rendering problem**`"}}

gitea-mermaid

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?

p {margin: 0}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions