Passing HTML markup into handlebars

worksolteana

New Member
I have an unusual situation where a client would like to place a line break in a string that is passed to handlebars from a JSON object. I've tried escaping characters but it isn't rendered by the DOM unsurprisingly. Any suggestions?\[code\]"company": "Lorem adscs ireland <br/> marketed as iuhmdsf in Europe"\[/code\]\[code\]var products = Data;var theTemplateScript = $("#product-template").html();var theTemplate = Handlebars.compile (theTemplateScript);$("#marketed-products .products").append (theTemplate(products));\[/code\]\[code\]{{#items}}<li><span class="company">{{company}}</li>{{/items}}\[/code\]The output from the code above should look something like thisLorem adscs ireland
marketed as iuhmdsf in Europe
 
Back
Top