Reputation: 14992
I got the wrong haml in http://html2haml.heroku.com/
How to convert it in proper way ?
Because the haml didn't render the identical html when I load the page
<style media="screen">
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0; left: 0; }
</style>
%style{media: "screen"}
:cdata
img { display: none; }
body { overflow: hidden; }
\#canvas { position: absolute; top: 0; left: 0; }
Upvotes: 5
Views: 19362
Reputation: 303
This should work for you, in case you don't want CDATA tokens in your code.
%style{media: "screen"}
:plain
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0; left: 0; }
Upvotes: 3
Reputation: 9747
You may want to try htmltohaml
Input:
<style media="screen">
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0; left: 0; }
</style>
Output:
%style{:media => "screen"}
img { display: none; }
body { overflow: hidden; }
\#canvas { position: absolute; top: 0; left: 0; }
Anyways, as Mandeep said, I also recommend that you should move your styles to stylesheets.
Upvotes: 2
Reputation: 17919
This should work
%body
:css
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0; left: 0; }
P.S. But this's a bad practice to render html content which should be located in separate file.
Upvotes: 13