Disable C/C++ highlight temporarily (#2754)

This commit is contained in:
Greg Bergé
2025-01-17 08:28:10 +01:00
committed by GitHub
parent 128ad20280
commit 29d59793dc
4 changed files with 12 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'gitbook': patch
---
Disable C/C++ highlight temporarily
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -59,7 +59,7 @@
"remark-rehype": "^11.1.0",
"rison": "^0.1.1",
"server-only": "^0.0.1",
"shiki": "^1.26.1",
"shiki": "^1.27.2",
"tailwind-merge": "^2.2.0",
"tailwind-shades": "^1.1.2",
"unified": "^11.0.4",
@@ -96,6 +96,12 @@ function getLanguageForSyntax(syntax: string): BundledLanguage | null {
// Normalize the syntax to lowercase.
syntax = syntax.toLowerCase();
// Temporary disable highlighting for C/C++ code blocks
// @see https://github.com/shikijs/shiki/issues/893
if (syntax === 'cpp' || syntax === 'c') {
return null;
}
// Check if the syntax is a bundled language.
if (checkIsBundledLanguage(syntax)) {
return syntax;