提交 b9b5692e 编写于 作者: M Matt Bierner

Support using csharp in markdown preview to identify c# code blocks

上级 50fe9db9
......@@ -297,13 +297,13 @@ async function getMarkdownOptions(md: () => MarkdownIt) {
html: true,
highlight: (str: string, lang?: string) => {
// Workaround for highlight not supporting tsx: https://github.com/isagalaev/highlight.js/issues/1155
if (lang && ['tsx', 'typescriptreact'].indexOf(lang.toLocaleLowerCase()) >= 0) {
if (lang && ['tsx', 'typescriptreact'].includes(lang.toLocaleLowerCase())) {
lang = 'jsx';
}
if (lang && lang.toLocaleLowerCase() === 'json5') {
lang = 'json';
}
if (lang && lang.toLocaleLowerCase() === 'c#') {
if (lang && ['c#', 'csharp'].includes(lang.toLocaleLowerCase())) {
lang = 'cs';
}
if (lang && hljs.getLanguage(lang)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册