Skip to content

Commit

Permalink
Update *-page to not include styles if no math is found (speech version)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed Aug 24, 2020
1 parent 9b509a4 commit e83655d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions speech/mml2svg-page
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ require('mathjax-full/' + (argv.dist ? 'es5' : 'components/src/mml-svg') + '/mml
MathJax.startup.promise.then(() => {
const adaptor = MathJax.startup.adaptor;
const html = MathJax.startup.document;
MathJax.startup.promise.then(() => {
console.log(adaptor.doctype(html.document));
console.log(adaptor.outerHTML(adaptor.root(html.document)));
});
if (html.math.toArray().length === 0) {
adaptor.remove(html.outputJax.svgStyles);
const cache = adaptor.elementById(adaptor.body(html.document), 'MJX-SVG-global-cache');
if (cache) adaptor.remove(cache);
}
console.log(adaptor.doctype(html.document));
console.log(adaptor.outerHTML(adaptor.root(html.document)));
}).catch(err => console.log(err));

0 comments on commit e83655d

Please sign in to comment.