Skip to content

Commit 652acef

Browse files
authored
Merge pull request #1791 from dpvc/issue1691
Fix CD problems cause by getNode(). #1691
2 parents 751ee29 + 161a389 commit 652acef

File tree

1 file changed

+6
-2
lines changed
  • unpacked/jax/output/CommonHTML

1 file changed

+6
-2
lines changed

unpacked/jax/output/CommonHTML/jax.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,16 @@
376376
//
377377
getNode: function (node,type) {
378378
var name = RegExp("\\b"+type+"\\b");
379+
var nodes = [];
379380
while (node) {
380381
for (var i = 0, m = node.childNodes.length; i < m; i++) {
381382
var child = node.childNodes[i];
382-
if (name.test(child.className)) return child;
383+
if (child) {
384+
if (name.test(child.className)) return child;
385+
if (child.id === "") nodes.push(child);
386+
}
383387
}
384-
node = (node.firstChild && (node.firstChild.id||"") === "" ? node.firstChild : null);
388+
node = nodes.shift();
385389
}
386390
return null;
387391
},

0 commit comments

Comments
 (0)