-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Compatibility issues with Nuxt Content #15
Comments
This HTML is weird. The Please provide a minimal reproduction. |
The HTML spec recommends this |
I created a minimal reproduction which you can find here: https://stackblitz.com/edit/github-9baaph?file=nuxt.config.ts,content%2Findex. It's essentially just the official minimal starter template, with syntax highlighting activated for demonstration purposes. Nuxt Content uses https://github.com/shikijs/shiki for highlighting under the hood, and it works just fine. Note that I didn't add the rehype-mermaid plugin since it wouldn't work anyway. |
And you are right, the |
It looks like Nuxt Content has the concept of a highlighter, which receives the code and language. It doesn’t seem to actually use the hast for this. I think the reason shiki works for Nuxt at all, is because it’s hooked into it using custom logic in such a highlighter. Since Nuxt Content produces weird HTML, I suggest you report an issue upstream indeed. I am open to further discussion if the Nuxt Content team has good arguments to produce this HTML. In the meantime you could implement a custom highlighter and use |
Hi,
Nuxt Content outputs code blocks in a slightly different way, which isn't recognized by your plugin.
The
isMermaidElement
function only checks for eitherpre
tags with themermaid
class ORcode
tags with thelanguage-mermaid
class. The 'mixed' version used by Nuxt Content doesn't work.rehype-mermaid/src/rehype-mermaid.ts
Line 67 in c87fb48
The text was updated successfully, but these errors were encountered: