Render HTML tags in PDF output
-
Hello,
My data consists of json like the image below and jsreport show it as <p>hello world</p> which I need it like hello world in html paragraph. I tried out handlebars but not found any solutions.
-
Use triple brackets to avoid escaping
{{{myProp}}}
https://handlebarsjs.com/guide/expressions.html#html-escaping
-
@jan_blaha thanks for the swift response,
I used 3 brackets, it shows the same <p>hello world</p> but I need it to be hello world.
You can see the sample code below.
-
Strange. Please share the link to the playground workspace.
-
-
The problem is that your input data are already escaped:
{ "results": { "overall": { "score": 43.7, "observedAverage": 50, "potential": 64 }, "summary": "<p>...;" } }
This means you need to reverse it and unescape the first. See how this can be done using a simple custom helper
https://playground.jsreport.net/w/anon/iuEpjLvy