Created
January 26, 2016 14:14
-
-
Save radist2s/ae1183a4bb8b495eaaf5 to your computer and use it in GitHub Desktop.
HTML template trim. Trim "CDATA" and spaces in html insade <script/> tag
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
window.templateTrim = function (templateHtml) { | |
return templateHtml.replace(/\/{2,}<!\[CDATA\[([\s\S]*)\/{2,}]]>/i, '$1').trim() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment