Am I right in saying that Knockout encodes HTML values when binding to a jQuery template.
How do I stop this? In the example below the ${Description} contains HTML tags that I do not want encoded.
<script id="QuoteHeaderTemplate" type="text/x-jQuery-tmpl">
<div class="heading group">
<div id="${Name}" class="title row group">
<div class="inner">
<a class="benefit-title" href="#">${Name}</a>
</div>
</div>
<div class="description group">
<div class="inner">
${Description}
</div>
</div>
</div>
</script>
<div data-bind='template: {name: "QuoteHeaderTemplate", foreach: benefits}'>
</div>
You would want to use the
{{html}}tag provided by the jQuery Templates plugin. Docs are here: http://api.jquery.com/template-tag-html/You would do:
{{html Description}}