Line break, using Enum.map

I’m trying to skip a line on the phoenix page.
However, the phoenix does not recognize this “\n” or “

Can you tell me why?

json |> Enum.map(&[&1.coluns, "\n"])
or
json |> Enum.map(&[&1.coluns, "<br>"])

But to no avail.

result = [[" Test .", "\n "]]

template

<table>
<tr>
<th><%= function() %></th>
</tr>
</table>

EEx based templating engine will secure you from XSS. If you want to achieve what you want you should use Phoenix.HTML helpers to create safe tag.

1 Like