A html string is escaped in haml file

garrydou picture garrydou · Jan 14, 2011 · Viewed 18.9k times · Source
#test
  - html = "<a href='http://www.a.com'>Test</a>"
  = html

The output is

<div id='test'>
  &lt;a href='http://www.a.com'&gt;Test&lt;/a&gt;
</div>

But I want a output:

<div id='test'>
  <a href='http://www.a.com'>Test</a>
</div>

Anyone has solutions? Thanks.

Answer

gunn picture gunn · Jan 14, 2011
= raw html

or:

= html.html_safe