-
-
Save mshirdel/6b5b8779d1b0882c5501 to your computer and use it in GitHub Desktop.
RegEx for replacing font tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Clear the highlighting to allow the user to toggle | |
* between the original page & the highlighted page. | |
*/ | |
function clearHighlighting() | |
{ | |
alert("clearing hightlighting..."); | |
if (!document.body || typeof(document.body.innerHTML) == "undefined") { | |
if (warnOnFailure) { | |
alert("Sorry, for some reason the text of this page is unavailable. Searching will not work."); | |
} | |
return false; | |
} | |
var re = new RegExp('<'+'font'+'[^><]*>|<.'+'font'+'[^><]*>','g') | |
var bodyText = document.body.innerHTML; | |
bodyText = bodyText.replace(re, ''); | |
document.body.innerHTML = bodyText; | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment