Skip to content

Commit c73e07d

Browse files
authored
Increase token max length to fix code not highlighted (#2629)
1 parent 6b5d7e6 commit c73e07d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/ten-parrots-argue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gitbook': patch
3+
---
4+
5+
Increase token max length to fix code not highlighted

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function highlight(block: DocumentBlockCode): Promise<HighlightLine
5050

5151
const lines = highlighter.codeToTokensBase(code, {
5252
lang: langName,
53-
tokenizeMaxLineLength: 120,
53+
tokenizeMaxLineLength: 400,
5454
});
5555

5656
let currentIndex = 0;

0 commit comments

Comments
 (0)