mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-06 03:38:39 +00:00
Make clearNode screaming-fast-er
Reviewers: xymostech Reviewed By: xymostech Differential Revision: http://phabricator.benalpert.com/D35
This commit is contained in:
@@ -87,9 +87,10 @@ var MJLite = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var clearNode = function(node) {
|
var clearNode = function(node) {
|
||||||
var children = node.childNodes;
|
if ("textContent" in node) {
|
||||||
for (var i = children.length - 1; i >= 0; i--) {
|
node.textContent = "";
|
||||||
node.removeChild(children[i]);
|
} else {
|
||||||
|
node.innerText = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user