-
Notifications
You must be signed in to change notification settings - Fork 437
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
Mermaid codeblock folding and copy button style issue #797
Comments
Yeah, that's strange. |
One possible scenario is that a race condition has occurred here. The mermaid script loads slowly, so the mermaid source code is initially treated as a regular code block with fold and copy buttons added, and only afterward is it rendered to svg format. |
I pushed to the mermaid branch: https://github.com/next-theme/hexo-theme-next/tree/mermaid |
Thanks, it's normal now |
Great, I will merge it into the master branch. |
Sadly, the copy button disappears too. Should I open a new issue for this feature request? |
The copy button is actually a bug; it requires the code block style to function properly. If users select a different highlighting engine (prismjs), style errors may occur. I will look into how to handle this when I have time later. |
You can check if the copy button is working now: 5c02480 |
This issue has been added to the latest roadmap. 🎉 |
There's copy button now, but it can't make copy action. Also breaks normal codeblock. |
I've fixed it again, you can checkout this commit: ddecbe3 |
It works normally now. Appreciating your great work! |
Issue Checklist
Expected behavior
Fold other codeblock, but don't fold mermaid codeblock.
It would be better if there's a copy button on mermaid codeblock as shown below by the way.
Actual behavior
Steps to reproduce the behavior
Node.js and NPM Information
Package dependencies Information
Hexo Configuration
Irrelevant
NexT Configuration
Other Information
Relevant to #694.
Besides, it works as expected sometimes.
Have issue: https://pilgrimlyieu.github.io/notes/D-discrete-mathematics/13-lattice#%E6%A0%BC%E5%90%8C%E6%80%81
No issue: https://pilgrimlyieu.github.io/daily/2024-04#Mermaid
The text was updated successfully, but these errors were encountered: