diff --git a/.changeset/silver-dancers-heal.md b/.changeset/silver-dancers-heal.md new file mode 100644 index 000000000..3be56e555 --- /dev/null +++ b/.changeset/silver-dancers-heal.md @@ -0,0 +1,5 @@ +--- +'gitbook': patch +--- + +Disable C/C++ highlight temporarily diff --git a/bun.lockb b/bun.lockb index c9c2b40b2..59ef693f7 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/gitbook/package.json b/packages/gitbook/package.json index f5242313f..b9d3b71f5 100644 --- a/packages/gitbook/package.json +++ b/packages/gitbook/package.json @@ -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", diff --git a/packages/gitbook/src/components/DocumentView/CodeBlock/highlight.ts b/packages/gitbook/src/components/DocumentView/CodeBlock/highlight.ts index a7b6d4b03..c3d6ee054 100644 --- a/packages/gitbook/src/components/DocumentView/CodeBlock/highlight.ts +++ b/packages/gitbook/src/components/DocumentView/CodeBlock/highlight.ts @@ -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;