Created
July 21, 2020 23:24
-
-
Save cvan/93376f56e5dd5a2bbbcf152490de7d66 to your computer and use it in GitHub Desktop.
strip html comments javascript
This file contains hidden or 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 stripHtmlComments(html) { | |
// Remove HTML comments (useful for removing developer-facing comments from production HTML markup). | |
return html.replace(/<!--[\s\S]*?(?:-->)/g, ''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment