Open mbana opened 5 years ago
I just had this same problem with a C# file. C# files usually end in .cs, if I do something like
<<< @/example/Program.cs
What's rendered isn't highlighted. However, if you change the extension to the language name prism expects, i.e.
<<< @/example/Program.csharp
Then things worked for me. So, for now, you may have to name your files config.yaml and Makefile.makefile. That's... not great.
It looks like https://github.com/vuejs/vuepress/blob/d8e6ecc22205aeed4c770d3f6ef5758cccbecd75/packages/%40vuepress/markdown/lib/snippet.js#L34 is just popping the file extension as the language name (which is why you can get away with appending {x,y} and having line highlights work, since that'll just come along as part of the extension).
https://vuepress.vuejs.org/guide/markdown.html#import-code-snippets
I've got this block of code in Markdown file:
Both work but the code is not highlighted. How do I specify the language when I import a code snippet?