File tree Expand file tree Collapse file tree 2 files changed +24
-15
lines changed Expand file tree Collapse file tree 2 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -95,15 +95,19 @@ async function renderMath() {
9595 katex = await getKatex ()
9696 }
9797 if (katex ) {
98- const html = katex .renderToString (props .node .content , {
99- throwOnError: false ,
100- displayMode: true ,
101- })
102- mathBlockElement .value .innerHTML = html
103- hasRenderedOnce = true
104- renderingLoading .value = false
105- // populate worker client cache so future calls hit cache
106- setKaTeXCache (props .node .content , true , html )
98+ try {
99+ const html = katex .renderToString (props .node .content , {
100+ throwOnError: props .node .loading ,
101+ displayMode: true ,
102+ })
103+ mathBlockElement .value .innerHTML = html
104+ hasRenderedOnce = true
105+ renderingLoading .value = false
106+ // populate worker client cache so future calls hit cache
107+ setKaTeXCache (props .node .content , true , html )
108+ }
109+ catch {
110+ }
107111 return
108112 }
109113 }
Original file line number Diff line number Diff line change @@ -85,12 +85,17 @@ async function renderMath() {
8585 katex = await getKatex ()
8686 }
8787 if (katex ) {
88- const html = katex .renderToString (props .node .content , { throwOnError: false , displayMode: false })
89- renderingLoading .value = false
90- mathElement .value .innerHTML = html
91- hasRenderedOnce = true
92- // populate worker client cache for inline as well
93- setKaTeXCache (props .node .content , false , html )
88+ try {
89+ const html = katex .renderToString (props .node .content , { throwOnError: props .node .loading , displayMode: false })
90+ renderingLoading .value = false
91+ mathElement .value .innerHTML = html
92+ hasRenderedOnce = true
93+ // populate worker client cache for inline as well
94+ setKaTeXCache (props .node .content , false , html )
95+ }
96+ catch {
97+ }
98+
9499 return
95100 }
96101 }
You can’t perform that action at this time.
0 commit comments