Skip to content

Commit

Permalink
Disable C/C++ highlight temporarily (#2754)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge authored Jan 17, 2025
1 parent 128ad20 commit 29d5979
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silver-dancers-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'gitbook': patch
---

Disable C/C++ highlight temporarily
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/gitbook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 29d5979

Please sign in to comment.