# Add line breaks to function, HTML

**URL:** <https://discourse.nodered.org/t/add-line-breaks-to-function-html/31143>\
**Category:** General\
**Created:** [4 August 2020 19:21 UTC](https://discourse.nodered.org/t/add-line-breaks-to-function-html/31143 "2020-08-04T19:21:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikewoodld](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikewoodld/32/26822_2.png) [@mikewoodld](https://discourse.nodered.org/u/mikewoodld)\
**Post date:** [4 August 2020 19:21 UTC](https://discourse.nodered.org/t/add-line-breaks-to-function-html/31143/1 "2020-08-04T19:21:06Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/03674ca6e8c885006ff08f7c38c762494055b1fc.png)  
Returns  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/9/2971af69c1d9a1b50a311a4749852d19a787aa8a.png)  
(after the msg was passed along into a flow variable)

I want to drop this flow variable onto a HTML page  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/6/d6816d0ab308337ee5141b85d38186876dc5f4dc.png)

But when I do, my line breaks don't appear:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/7/27ffa8d55982d3b1f5dab63e60fbe90b478e45c1.png)

(ignore the fact that the names don't match, I hadn't refreshed when I took the screenshots)

I've tried putting` <br>` in, but I get the text \<br\> output instead.

I'd love some guidance on how I can pass these line returns along into my HTML template.

Thanks!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 August 2020 19:33 UTC](https://discourse.nodered.org/t/add-line-breaks-to-function-html/31143/2 "2020-08-04T19:33:04Z")

</div>

hi @mikewoodld

The problem stems from the fact line breaks are ignored in HTML by default.

There are two possible ways to fix it...

1. modify your HTML template to wrap your content in `<pre></pre>` tags - by default, those tags will honour the whitespace new lines in your content.

```auto
   <b>Players On Ice:</b>
   <pre>{{flow.homeOnIce}}</pre>

```

1. Add html to your content (ie `<br>` as you have tried), but then you must update your template to use `{{{`-triple-brackets-`}}}` - otherwise the template engine escapes HTML content:

```auto
   <b>Players On Ice:</b>
   {{{flow.homeOnIce}}}

```

---

<div class="post-metadata">

**Author:** ![mikewoodld](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikewoodld/32/26822_2.png) [@mikewoodld](https://discourse.nodered.org/u/mikewoodld)\
**Post date:** [4 August 2020 20:10 UTC](https://discourse.nodered.org/t/add-line-breaks-to-function-html/31143/3 "2020-08-04T20:10:21Z")

</div>

Perfect, exactly what I was looking for. Thanks so much!

---

<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:** [18 August 2020 20:10 UTC](https://discourse.nodered.org/t/add-line-breaks-to-function-html/31143/4 "2020-08-18T20:10:28Z")

</div>

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