So I came across this article which has a fix for this (also changes the <% %> to <# #> FYI
str.replace(/[\r\t\n]/g, " ")
.replace(/'(?=[^#]*#>)/g, "\t")
.split("'").join("\\'")
.split("\t").join("'")
.replace(/<#=(.+?)#>/g, "',$1,'")
.split("<#").join("');")
.split("#>").join("p.push('")
+ "');}return p.join('');";
http://weblog.west-wind.com/posts/2008/Oct/13/Client-Templating-with-jQuery