mathjax / MathJax-node

MathJax for Node
Apache License 2.0
615 stars 97 forks source link

extraneous delimiters cause unexpected results #226

Closed pkra closed 8 years ago

pkra commented 8 years ago

While responding to @fptoth's comment, I noticed that

$$  VBeBorn=reflexiveVP\ (P.dirV2(v\_besch106{\hbox{}}na\c{s}te{\hbox{"}})).$$

passed to mj-single would yield an empty result (e.g., <math xmlns="http://www.w3.org/1998/Math/MathML" display="block" /> etc.)

I'm not sure why the incorrect delimiters would throw mathjax-node off.

pkra commented 8 years ago

Oh, I see.

Was there a reason not to create the script directly tag?

dpvc commented 8 years ago

Do you mean that the dollar signs were passed as part of the math? That would mean that the page would contain

$$$$ ... $$$$

and so the first two dollars are matched be the second two, with no contents between them. So the math expression is empty, and you would get an empty math output. I assume you figured that out ("Oh, I see."), but I'm adding it here for documentation for the future.

You are right, adding a script of the proper type would probably be a better idea.

dpvc commented 8 years ago

The issue226 branch includes the needed changes. It also removes the need for the preprocessors, so I've removed them as well.

pkra commented 8 years ago

Do you mean that the dollar signs were passed as part of the math?

Yes, that's what I had meant. Thanks for the quick fix!