Update: html5lib
(bottom of question) seems to get close, I just need to improve my understanding of how it\'s used.
I am attempting to
I added comment tags () in my jQuery template blocks (CDATA blocks also failed) and DOMDocument did not touch the internal HTML.
Then, before I used the jQuery templates, I wrote a script to remove the comments.
$(function() {
$('script[type="text/x-jquery-tmpl"]').text(function() {
// The comment node in this context is actually a text node.
return $.trim($(this).text()).replace(/^$/, '$1');
});
});
Not ideal, but I wasn't sure of a better workaround.