# How to properly inject html content into template?

**URL:** <https://discourse.nodered.org/t/how-to-properly-inject-html-content-into-template/77397>\
**Category:** General\
**Created:** [9 April 2023 21:32 UTC](https://discourse.nodered.org/t/how-to-properly-inject-html-content-into-template/77397 "2023-04-09T21:32:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davi-sillva](https://avatars.discourse-cdn.com/v4/letter/d/e9a140/32.png) [@davi-sillva](https://discourse.nodered.org/u/davi-sillva)\
**Post date:** [9 April 2023 21:32 UTC](https://discourse.nodered.org/t/how-to-properly-inject-html-content-into-template/77397/1 "2023-04-09T21:32:54Z")

</div>

I'm trying to inject html code into a template node to then build a dynamic html. The content for the dynamic html is coming from a function that returns an object containing the required data.

For some reason the html tags are being converted wrong as seen in the image below:

 ![Screenshot from 2023-04-09 23-29-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/4/1404126b2a6b18d4a390f24511127c9d519c7f13.png)

How do I solve this issue?

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [10 April 2023 00:30 UTC](https://discourse.nodered.org/t/how-to-properly-inject-html-content-into-template/77397/2 "2023-04-10T00:30:01Z")

</div>

You will need to share more context. Clearly, the input is being converted to safe text rather than being left as HMTL but we can't see what is doing that without you sharing the flow.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [10 April 2023 07:25 UTC](https://discourse.nodered.org/t/how-to-properly-inject-html-content-into-template/77397/3 "2023-04-10T07:25:35Z")

</div>

At a guess , as you mention template node, if you are using mustache template, then to stop the conversion of html chars to safte text use `{{{ }}}` as mentioned in the sidebar help text.

> **Note:** By default, _mustache_ will escape any non-alphanumeric or HTML entities in the values it substitutes. To prevent this, use `{{{triple}}}` braces.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [9 June 2023 07:25 UTC](https://discourse.nodered.org/t/how-to-properly-inject-html-content-into-template/77397/4 "2023-06-09T07:25:43Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
