File tree Expand file tree Collapse file tree 5 files changed +13
-0
lines changed
Expand file tree Collapse file tree 5 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ require('mathjax-full').init({
8282 //
8383 const adaptor = MathJax . startup . adaptor ;
8484 const html = MathJax . startup . document ;
85+ if ( html . math . toArray ( ) . length === 0 ) adaptor . remove ( html . outputJax . chtmlStyles ) ;
8586 console . log ( adaptor . doctype ( html . document ) ) ;
8687 console . log ( adaptor . outerHTML ( adaptor . root ( html . document ) ) ) ;
8788} ) . catch ( err => console . log ( err ) ) ;
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ require('mathjax-full').init({
8282 //
8383 const adaptor = MathJax . startup . adaptor ;
8484 const html = MathJax . startup . document ;
85+ if ( html . math . toArray ( ) . length === 0 ) adaptor . remove ( html . outputJax . chtmlStyles ) ;
8586 console . log ( adaptor . doctype ( html . document ) ) ;
8687 console . log ( adaptor . outerHTML ( adaptor . root ( html . document ) ) ) ;
8788} ) . catch ( err => console . log ( err ) ) ;
Original file line number Diff line number Diff line change @@ -82,6 +82,11 @@ require('mathjax-full').init({
8282 //
8383 const adaptor = MathJax . startup . adaptor ;
8484 const html = MathJax . startup . document ;
85+ if ( html . math . toArray ( ) . length === 0 ) {
86+ adaptor . remove ( html . outputJax . svgStyles ) ;
87+ const cache = adaptor . elementById ( adaptor . body ( html . document ) , 'MJX-SVG-global-cache' ) ;
88+ if ( cache ) adaptor . remove ( cache ) ;
89+ }
8590 console . log ( adaptor . doctype ( html . document ) ) ;
8691 console . log ( adaptor . outerHTML ( adaptor . root ( html . document ) ) ) ;
8792} ) . catch ( err => console . log ( err ) ) ;
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ require('mathjax-full').init({
9494 //
9595 const adaptor = MathJax . startup . adaptor ;
9696 const html = MathJax . startup . document ;
97+ if ( html . math . toArray ( ) . length === 0 ) adaptor . remove ( html . outputJax . chtmlStyles ) ;
9798 console . log ( adaptor . doctype ( html . document ) ) ;
9899 console . log ( adaptor . outerHTML ( adaptor . root ( html . document ) ) ) ;
99100} ) . catch ( err => console . log ( err ) ) ;
Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ require('mathjax-full').init({
9494 //
9595 const adaptor = MathJax . startup . adaptor ;
9696 const html = MathJax . startup . document ;
97+ if ( html . math . toArray ( ) . length === 0 ) {
98+ adaptor . remove ( html . outputJax . svgStyles ) ;
99+ const cache = adaptor . elementById ( adaptor . body ( html . document ) , 'MJX-SVG-global-cache' ) ;
100+ if ( cache ) adaptor . remove ( cache ) ;
101+ }
97102 console . log ( adaptor . doctype ( html . document ) ) ;
98103 console . log ( adaptor . outerHTML ( adaptor . root ( html . document ) ) ) ;
99104} ) . catch ( err => console . log ( err ) ) ;
You can’t perform that action at this time.
0 commit comments