Skip to content
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

Problems caused by language #2020

Open
zhangjiahaoGitHub opened this issue Dec 7, 2023 · 4 comments
Open

Problems caused by language #2020

zhangjiahaoGitHub opened this issue Dec 7, 2023 · 4 comments

Comments

@zhangjiahaoGitHub
Copy link

1701943875131
image
The rendered dom is different.
As a result, the following one cannot adapt to the height.

@benjaminwil
Copy link
Member

This seems to be an issue with Mermaid upstream, but I'm unsure exactly how to even report the issue to Mermaid.

I was able to reproduce using an emoji, as well. To quickly reproduce you can save a Gollum page with this content:

 Correct height Mermaid diagrams:

```mermaid
sequenceDiagram
    participant a as a
    participant b as b
    participant c as c
    participant d as d
```

```mermaid
pie title NETFLIX
    "Time spent looking for movie" : 90
    "Time spent watching it" : 10
```

Mermaid diagram frame is too small:

```mermaid
sequenceDiagram
    participant a as 😪
    participant b as b
    participant c as c
    participant d as d
```

Where the first two diagrams appear correctly and the last one appears the same way that the original issue message describes.

@dometto
Copy link
Member

dometto commented Apr 21, 2024

Could it be that gollum (gollum-lib in this case) is not properly setting the encoding of the text in the mermaid block?

I spoke too soon, I thought the issue was with the unicode text not being correctly rendered at all. It may be that this is something to do with mermaid's sandbox mode.

@benjaminwil
Copy link
Member

I was able to make a much more exaggerated reproduction:

Screenshot 2024-04-21 at 12 01 26 PM
Correct:

```mermaid
pie title NETFLIX
    "one" : 90
    "two" : 10
```

Incorrect:

```mermaid
pie title NETFLIX
    "😪" : 90
    "😠" : 10
```

@dometto
Copy link
Member

dometto commented Apr 21, 2024

Looks like it is indeed an issue with sandbox mode, see here. If you remove the securityLevel: 'sandbox' from the configuration, both diagrams render as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants