Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render raw html in Phoenix framework

I am trying to render raw html like this ->

<%= raw "<noscript>\n <div style=\"width: 302px; height: 422px;\">\n </div>\n </noscript> \n\n\n" %>

but when I use Edit as Html in Chrome to get the code I see the following ->

<noscript>
  &lt;div style="width: 302px; height: 422px;"&gt; &lt;/div&gt;    
</noscript>

which is obviously not what I want. What am I missing here? Why the content inside the noscript is being escaped? What's the right way to render this string as html ?

like image 714
NoDisplayName Avatar asked Oct 19 '22 04:10

NoDisplayName


1 Answers

This isn't a Phoenix issue. This is just how chrome handles when you edit as html. You can see the same thing in action at http://jsfiddle.net/h6crtf2m

<noscript><div></div></noscript>
like image 194
Gazler Avatar answered Oct 22 '22 00:10

Gazler