jerryc127 / hexo-theme-butterfly

🦋 A Hexo Theme: Butterfly
https://butterfly.js.org
Apache License 2.0
6.82k stars 1.24k forks source link

[Bug]: mermaid无法渲染 #1399

Closed Yu-Zhi-Jiang closed 6 months ago

Yu-Zhi-Jiang commented 8 months ago

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.10.0

是否修改过主题文件? || Has the theme files been modified?

是 (Yes)

使用的瀏覽器? || What browse are you using?

Edge

使用的系統? || What operating system are you using?

Windows

問題描述 | Describe the bug

问题:mermaid设置为true了,使用了{% mermaid %}的语法,但无法生成图。

个人尝试修复:查看其他issue看到了使用hexo-filter-mermaid-diagrams插件的解决办法,但无法直接使用。参考https://github.com/webappdevelp/hexo-filter-mermaid-diagrams#step3-include-mermaidjs-in-pug-or-ejs 更改了pug文件,已在本地测试通过。

出現問題網站 | Website

https://yu-zhi-jiang.github.io/2023/10/30/mermaid-test/

jerryc127 commented 7 months ago

我看了你的网站 你的 {% mermaid %} 用在代码块里面? 你这样只会渲染成代码块啊

Yu-Zhi-Jiang commented 7 months ago

我看了你的网站 你的 {% mermaid %} 用在代码块里面? 你这样只会渲染成代码块啊

啊这,看了官方文档以为就是写在代码块内才能生效的……已测试没问题了,感谢作者!

会考虑支持使用类似Typora的语法进行渲染吗,即我贴的链接的方案。对使用Typora的用户来说就不用维护两份代码了。

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.