5

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 ?

NoDisplayName
  • 15,246
  • 12
  • 62
  • 98
  • 2
    This is not something I can recreate. Are you sure chrome isn't escaping? Can you grab the html file directly and inspect it? Are you using a template engine other than EEx? What phoenix and phoenix_html versions? – Chris McCord Aug 25 '15 at 07:59
  • @ChrisMcCord Could you please pull this repo -> https://github.com/JustMikey/phoenix-test-app , open the app main page and inspect the bottom of the main container, I've added that code there and it doesn't seem to work, at least on my machine ... – NoDisplayName Aug 25 '15 at 08:20
  • 1
    @JustMichael This isn't a Phoenix issue. This is just how chrome handles ` – Gazler Aug 25 '15 at 08:32
  • @Gazler Yeah, looks like you are right. Thank you for help. You can post it as an answer and I'll accept it. – NoDisplayName Aug 25 '15 at 08:38

1 Answers1

3

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>
Gazler
  • 83,029
  • 18
  • 279
  • 245