Moving to Handlebars.js for client-side templating will help with this, as it auto-escapes.