Skip to content

Instantly share code, notes, and snippets.

@radist2s
Created January 26, 2016 14:14
Show Gist options
  • Save radist2s/ae1183a4bb8b495eaaf5 to your computer and use it in GitHub Desktop.
Save radist2s/ae1183a4bb8b495eaaf5 to your computer and use it in GitHub Desktop.
HTML template trim. Trim "CDATA" and spaces in html insade <script/> tag
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