Skip to content

Commit

Permalink
Merge pull request #759 from mathjax/issue2805
Browse files Browse the repository at this point in the history
Trim MathML string before parsing it.  (mathjax/MathJax#2805)
  • Loading branch information
dpvc authored Feb 22, 2022
2 parents 4599d86 + 36984d1 commit f0bbcdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ts/input/mathml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class MathML<N, T, D> extends AbstractInputJax<N, T, D> {
public compile(math: MathItem<N, T, D>, document: MathDocument<N, T, D>) {
let mml = math.start.node;
if (!mml || !math.end.node || this.options['forceReparse'] || this.adaptor.kind(mml) === '#text') {
let mathml = this.executeFilters(this.preFilters, math, document, math.math || '<math></math>');
let mathml = this.executeFilters(this.preFilters, math, document, (math.math || '<math></math>').trim());
let doc = this.checkForErrors(this.adaptor.parse(mathml, 'text/' + this.options['parseAs']));
let body = this.adaptor.body(doc);
if (this.adaptor.childNodes(body).length !== 1) {
Expand Down

0 comments on commit f0bbcdc

Please sign in to comment.