Closed Sun-ZhenXing closed 2 weeks ago
Hmm, weird, jinja-html grammar is there but it's not part of shikis' bundledLanguages 👀
I don't think injections are even supposed to be used directly. (https://github.com/shikijs/textmate-grammars-themes/blob/main/packages/tm-grammars/README.md#injections)
Why not use just jinja
?
I've been using jinja-html
without any problems, and it's only with the recent update that I encounter this problem.
Is it possible to have some way of injecting the language that avoids going directly to creating shiki
obj?
The issue is it was never supposed to work. Those are internal languages. Only top-level languages are meant to be used directly. That's why if you visit https://shiki.style/ you will only see jinja. There is no jinja-html.
It's recommended that you use jinja
instead. You can easily find and replace across your project. But if you want to still use jinja-html, you can explicitly load jinja:
import { defineConfig } from 'vitepress'
export default defineConfig({
markdown: {
async shikiSetup(highlighter) {
await highlighter.loadLanguage('jinja')
}
}
})
Thank you, it worked well.
Describe the bug
Cannot render
jinja-html
:Reproduction
markdown:
Additional context
Use this config dose not work, but the warning disappeared:
Validations