The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
3k
stars
605
forks
source link
Code block markup does not follow recommendations by WHATWG, causes issues with 3rd party plugins #2628
Open
testudor opened 1 month ago
Environment
Build Modules: -
Reproduction
https://stackblitz.com/edit/github-9baaph?file=nuxt.config.ts,content%2Findex.md
Describe the bug
The WHATWG (Web Hypertext Application Technology Working Group) recommends code block markup to be structured as follows:
(taken from https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-code-element)
Nuxt Content uses a different format, where the
language-xxx
class is placed on thepre
element instead. This breaks compatibility with some 3rd party plugins such as https://github.com/remcohaszing/rehype-mermaid. Is there any good reason Nuxt Content does not follow the spec? Please also see the discussion here: https://github.com/remcohaszing/rehype-mermaid/issues/15.Additional context
No response
Logs
No response