Hello, I'm trying to remove the CDATA wrapper in the following script (content has to be wrapped by CDATA to pass XHTML validation):
<script id="tplTest" type="text/html">
//<![CDATA[
<p id="msg">Hello</p>
<p>Another test: <#= ddd.ArtID #></p>
//]]>
</script>
This js script:
var strTmp=document.getElementById("tplTest").innerHTML;
var strNew= strTmp.replace(/[\/(\/!\[)\]CDATA]/g,"").replace(/[(\/\/\]\])]/g,"");
removes most to the CDATA mark-up except for the start/end<,> tags:
<
<p id="msg">Hello<p>
<p>nother test: <#= ddd.rtI #><p>
>
Question: How should I modify the js function to additionally remove these leading and trailing <,> tags? TIA for any hints.