Closed karbuncle closed 8 years ago
Thanks for reporting this. This does not look like an upstream asciimath issue.
Actually, I think it is an upstream bug. The error is being caught at line 1064, where they are looking up newFrag.childNodes[len-1].lastChild.firstChild.nodeValue
. Here, newFrag
is going to form the <mrow>
for the outer {: ... :}
, and it has len
equal to 1. It's one child is the <mrow>
from the inner {: :}
, which is empty, so has no children. So newFrag.childNodes[0]
is the empty <mrow>
, and newFrag.childNodes[0].lastChild
is null
(correctly), so when firstChild
is requested of that, it is an error.
The reason it works for {: {: a :} :}
is that the inner <mrow>
now contains <mi>a</mi>
and so newFrag.childNodes[len-1].lastChild
is the <mi>
and newFrag.childNodes[len-1].lastChild.firstChild
is the text node containing a
, and the nodeValue
will be "a"
, so all is well.
The reason {: {: :} a :}
works (but {: a {: :} :}
doesn't) is that this code is only reached if newFrag.childNodes[len-1].nodeName == "mrow"
, but in this case, newFrag
has len
equal to 2, and so newFrag.childNodes[len-1]
is the <mi>a</mi>
not the empty <mrow>
, and the condition isn't met, so the code isn't run.
Thanks, @dpvc -- I'll file a bug upstream at https://github.com/asciimath/asciimathml/issues/40
Fixed upstream.
@dpvc do we add this to the 2.6 milestone? I'm ok either way.
@pkra, I think we should update the AsciiMath input jax to the current state of asciimathml at the end of the beta test phase. We don't really have anything in the test suite to test AscaiiMath ourselves, so I don't think it matters how late that is done.
:+1:
This was fixed in 2.6 (via the upstream issue).
It seems to cause Math processing error whenever the pair of brackets
{: :}
is wrapped in another pair of brackets{: :}
, and is the only thing in that bracket.Examples: