markdown不支持c++ #84

Closed
opened 2023-08-05 21:49:05 +08:00 by clint-sfy · 1 comment
clint-sfy commented 2023-08-05 21:49:05 +08:00 (Migrated from github.com)

大佬,可以运行,但是build会因为The language 'c++' is not loaded, falling back to 'txt' for syntax highlighting. (x20)太多而构建失败咋办

大佬,可以运行,但是build会因为The language 'c++' is not loaded, falling back to 'txt' for syntax highlighting. (x20)太多而构建失败咋办
Charles7c commented 2023-08-05 23:04:36 +08:00 (Migrated from github.com)

把 c++ 换成 cpp 就可以了,VitePress 使用 shiki 实现的 Markdown 代码语法高亮,shiki 中目前就是用 cpp 来表示的 c++。

#include <stdio.h>

int main() {
	printf("Hello World!");
	return 0;
}

image

image

详见:https://github.com/shikijs/shiki/blob/main/docs/languages.md

把 c++ 换成 cpp 就可以了,VitePress 使用 shiki 实现的 Markdown 代码语法高亮,shiki 中目前就是用 cpp 来表示的 c++。 ```cpp #include <stdio.h> int main() { printf("Hello World!"); return 0; } ``` ![image](https://github.com/Charles7c/charles7c.github.io/assets/25446948/e478950a-4948-445e-8add-a71d5c733616) ![image](https://github.com/Charles7c/charles7c.github.io/assets/25446948/dd69b85a-cad1-4a0c-879b-e9af297b7bbc) 详见:https://github.com/shikijs/shiki/blob/main/docs/languages.md
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Charles7c/vitepress-theme-blog-charles7c-s1#84
No description provided.