Skip to content

Commit

Permalink
Added Polyfill for NodeList.forEach() so showdown-katex works in IE a…
Browse files Browse the repository at this point in the history
…nd earlier versions of Edge Related to #1197
  • Loading branch information
laurenwalker committed Dec 4, 2019
1 parent 6af3050 commit 3312362
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/loader.js
Expand Up @@ -375,6 +375,12 @@ MetacatUI.preventCompatibilityIssues = function(){
return -1;
};
}

//Polyfill for NodeList.forEach, which isn't supported in IE at all, or Edge before v16.
// https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill
if (window.NodeList && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = Array.prototype.forEach;
}
}

if (typeof Object.assign != 'function') {
Expand Down

0 comments on commit 3312362

Please sign in to comment.