String to html | Community
Skip to main content
Level 2
August 14, 2024
Solved

String to html

  • August 14, 2024
  • 1 reply
  • 502 views

I am assigning text to a variable and including basic HTML in it like, br-tag  and some CSS.
But, when the test displays in my email it does not process the HTML or CSS, for example,

 

 

 

 

{% let myCopy = "Lorem ipsum sit amet,<br />consectetur adipiscing elit, sed do <span style="color:red">eiusmod</span> tempor incididunt ut magna aliqua" %}

 

 

The output is,

 

"Lorem ipsum sit amet,<br />consectetur adipiscing elit, sed do <span style="color:red">eiusmod</span> tempor incididunt ut magna aliqua"

 

 
Not, 
"Lorem ipsum sit amet,
consectetur adipiscing elit, sed do eiusmod"

I would normally use something like this, to get the proper output,
stringToHTML
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by GeorgeVi2

Never mind, I got it. You need to use triple curly braces if you want to output html. 

 

{{{html}}}.

1 reply

GeorgeVi2AuthorAccepted solution
Level 2
August 14, 2024

Never mind, I got it. You need to use triple curly braces if you want to output html. 

 

{{{html}}}.