File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
src/components/DocumentView/CodeBlock Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,6 @@ type InlineIndexed = { inline: any; start: number; end: number };
29
29
30
30
type PositionedToken = ThemedToken & { start : number ; end : number } ;
31
31
32
- const renderer = asyncMutexFunction ( ) ;
33
- let blockCount = 0 ;
34
32
let lineCount = 0 ;
35
33
36
34
const LINE_LIMIT = 1000 ;
@@ -46,13 +44,9 @@ export async function highlight(block: DocumentBlockCode): Promise<HighlightLine
46
44
return plainHighlighting ( block ) ;
47
45
}
48
46
49
- const overLimit = await renderer . runBlocking ( async ( ) => {
50
- lineCount += block . nodes . length ;
51
- blockCount ++ ;
52
- return lineCount > LINE_LIMIT ;
53
- } )
54
-
55
- if ( overLimit ) {
47
+ lineCount += block . nodes . length ;
48
+ console . log ( `highlight, lineCount ${ lineCount } ` ) ;
49
+ if ( lineCount > LINE_LIMIT ) {
56
50
return plainHighlighting ( block ) ;
57
51
}
58
52
@@ -72,7 +66,7 @@ export async function highlight(block: DocumentBlockCode): Promise<HighlightLine
72
66
} ) ;
73
67
74
68
console . log (
75
- `${ block . key } ${ JSON . stringify ( { blockCount , lineCount } ) } block has ${
69
+ `${ block . key } lines: ${ lineCount } block has ${
76
70
block . nodes . length
77
71
} lines, ${ code . length } characters ${ inlines . length } inlines`,
78
72
) ;
You can’t perform that action at this time.
0 commit comments