jeffreytse / jekyll-spaceship

🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
MIT License
626 stars 67 forks source link

mermaid diagram cut the last char #60

Open copdips opened 3 years ago

copdips commented 3 years ago

Hello,

When using this plugin with https://github.com/jeffreytse/jekyll-deploy-action to render mermaid in github pages. I'm currently facing the same issue discribed at https://github.com/mermaid-js/mermaid/issues/790.

As per https://github.com/mermaid-js/mermaid/issues/790#issuecomment-568624450, the newer API version seems to fix the issue,

I dont know how jeklly-spaceship works for mermaid, maybe just need to update the API version too to fix the issue.

https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted?id=requirements-for-the-mermaid-api

jeffreytse commented 3 years ago

Hi @copdips

Thanks for your reporting, I used the below code to test, but I didn't see the issue, could you please provide me steps to reproduce this issue?

```mermaid!
graph TD
A[Something] -->|begets| B[Something]
```

The result in my environment:

2021-09-14_16-40

Thanks and Regards

copdips commented 3 years ago

@jeffreytse

It's the rendering in github pages bugs as shown below:

image

And below is what I see in locally env where the rendering is good.

image

jeffreytse commented 3 years ago

@copdips Thanks for your useful information, basically it's a render issue of SVG image of Mermaid on calculating text size, core issue is to round the value to integer from float, if your graph direction is TB, it will not happen. I will try to research and settle down this issue as soon as possible with a compatibility solution.