Last active
March 1, 2021 04:08
-
-
Save leodutra/3790735 to your computer and use it in GitHub Desktop.
Remove HTML/JavaScript Comments
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
function removeComments(html) { | |
return (''+html) | |
.replace/*HTMLComments*/(/<!-[\S\s]*?-->/gm, '') | |
.replace/*JSBlockComments*/(/\/\*[\S\s]*?\*\//gm,'') | |
.replace/*JSLineComments*/(/^.*?\/\/.*/gm, '$1') // FIXME | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kuiloiulio;io;;