Default highlight language for code blocks #3417
-
Hi! Currently I have more than 100 code blocks with yaml syntax. And in each code block I have to specify yaml language: Is it possible to set yaml language as default language for whole project? I don't like to put it in each code block |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is no easy way as fenced code blocks just aren't specced to work like you are suggesting, but there is a way to do so with custom fences. You'd have to override the default fences and wrap its logic with some that specify the language as I'm on vacation right now, so I don't really have time to show an example here, but when I get back, I can probably illustrate what I mean. |
Beta Was this translation helpful? Give feedback.
There is no easy way as fenced code blocks just aren't specced to work like you are suggesting, but there is a way to do so with custom fences. You'd have to override the default fences and wrap its logic with some that specify the language as
yaml
if no language is provided.I'm on vacation right now, so I don't really have time to show an example here, but when I get back, I can probably illustrate what I mean.