User:Brainycube/common.js

// fix superscripts var re = /^(.*)\[(.+?)\](.*)$/; var i, j; var sups = document.querySelectorAll("sup"); for (i = 0; i < sups.length; i++) { var match = sups[i].innerHTML.match(re); if (match != null) { sups[i].innerHTML = match[1] + match[2] + " " + match[3]; }   // unitalicize superscripts var iTags = sups[i].querySelectorAll("i"); for (j = 0; j < iTags.length; j++) { var iContent = iTags[j].innerHTML; iTags[j].parentNode.innerHTML = iContent; } }