Fix a problem with IE when parentNode is null.

Apparently IE removes empty text nodes, and so the open.parentNode can
be null.  So check before trying to remove the node.  This resolves
the issue raised by
https://sourceforge.net/projects/mathjax/forums/forum/948700/topic/3902096
This commit is contained in:
Davide P. Cervone 2010-10-20 22:46:30 -04:00
parent c35cfc9e9f
commit 266328ebca

View File

@ -210,7 +210,7 @@ MathJax.Extension.tex2jax = {
if (element === search.close) {element = close}
search.close = close;
var math = search.open.splitText(search.opos);
if (search.open.nodeValue === "") {search.open.parentNode.removeChild(search.open)}
if (search.open.nodeValue === "" && search.open.parentNode) {search.open.parentNode.removeChild(search.open)}
while (math.nextSibling && math.nextSibling !== close) {
if (math.nextSibling.nodeValue !== null) {
if (math.nextSibling.nodeName === "#comment") {