File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,26 @@ const dotHandler: LanguageHandler = {
54
54
options : Record < string , unknown > ,
55
55
) {
56
56
const cellContent = handlerContext . cellContent ( cell ) ;
57
+
57
58
const graphvizModule = await import (
58
59
resourcePath ( join ( "js" , "graphviz-wasm.js" ) )
59
60
) ;
60
61
let svg ;
62
+ const oldConsoleLog = console . log ;
63
+ const oldConsoleWarn = console . warn ;
64
+ console . log = ( ) => { } ;
65
+ console . warn = ( ) => { } ;
61
66
try {
62
67
svg = await graphvizModule . graphviz ( ) . layout (
63
68
cellContent . value ,
64
69
"svg" ,
65
70
options [ "graph-layout" ] ,
66
71
) ;
72
+ console . log = oldConsoleLog ;
73
+ console . warn = oldConsoleWarn ;
67
74
} catch ( e ) {
75
+ console . log = oldConsoleLog ;
76
+ console . warn = oldConsoleWarn ;
68
77
const m = ( e . message as string ) . match (
69
78
/ ( .* ) s y n t a x e r r o r i n l i n e ( \d + ) ( .* ) / ,
70
79
) ;
You can’t perform that action at this time.
0 commit comments