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 = {
5454 options : Record < string , unknown > ,
5555 ) {
5656 const cellContent = handlerContext . cellContent ( cell ) ;
57+
5758 const graphvizModule = await import (
5859 resourcePath ( join ( "js" , "graphviz-wasm.js" ) )
5960 ) ;
6061 let svg ;
62+ const oldConsoleLog = console . log ;
63+ const oldConsoleWarn = console . warn ;
64+ console . log = ( ) => { } ;
65+ console . warn = ( ) => { } ;
6166 try {
6267 svg = await graphvizModule . graphviz ( ) . layout (
6368 cellContent . value ,
6469 "svg" ,
6570 options [ "graph-layout" ] ,
6671 ) ;
72+ console . log = oldConsoleLog ;
73+ console . warn = oldConsoleWarn ;
6774 } catch ( e ) {
75+ console . log = oldConsoleLog ;
76+ console . warn = oldConsoleWarn ;
6877 const m = ( e . message as string ) . match (
6978 / ( .* ) s y n t a x e r r o r i n l i n e ( \d + ) ( .* ) / ,
7079 ) ;
You can’t perform that action at this time.
0 commit comments