Add line breaks to function, HTML


Returns
image
(after the msg was passed along into a flow variable)

I want to drop this flow variable onto a HTML page
image

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

(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!

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.
   <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:
   <b>Players On Ice:</b>
   {{{flow.homeOnIce}}}
1 Like

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

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