From 266328ebca601baca46580be69e99a3220c8e985 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 20 Oct 2010 22:46:30 -0400 Subject: [PATCH] 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 --- mathjax/unpacked/extensions/tex2jax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mathjax/unpacked/extensions/tex2jax.js b/mathjax/unpacked/extensions/tex2jax.js index a5a1b60e3..7871b27b4 100644 --- a/mathjax/unpacked/extensions/tex2jax.js +++ b/mathjax/unpacked/extensions/tex2jax.js @@ -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") {