Skip to content

Commit 29d5979

Browse files
authored
Disable C/C++ highlight temporarily (#2754)
1 parent 128ad20 commit 29d5979

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

.changeset/silver-dancers-heal.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Disable C/C++ highlight temporarily

bun.lockb

-8 Bytes
Binary file not shown.

packages/gitbook/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"remark-rehype": "^11.1.0",
6060
"rison": "^0.1.1",
6161
"server-only": "^0.0.1",
62-
"shiki": "^1.26.1",
62+
"shiki": "^1.27.2",
6363
"tailwind-merge": "^2.2.0",
6464
"tailwind-shades": "^1.1.2",
6565
"unified": "^11.0.4",

packages/gitbook/src/components/DocumentView/CodeBlock/highlight.ts

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ function getLanguageForSyntax(syntax: string): BundledLanguage | null {
9696
// Normalize the syntax to lowercase.
9797
syntax = syntax.toLowerCase();
9898

99+
// Temporary disable highlighting for C/C++ code blocks
100+
// @see https://github.com/shikijs/shiki/issues/893
101+
if (syntax === 'cpp' || syntax === 'c') {
102+
return null;
103+
}
104+
99105
// Check if the syntax is a bundled language.
100106
if (checkIsBundledLanguage(syntax)) {
101107
return syntax;

0 commit comments

Comments
 (0)