December 10, 2007 at 04:18 PM
On Haml, standards, quotation marks, and looking like everyone else.
There’s a bit of a debate going on over in the Haml Google Group. By default, Haml uses single quotation marks to wrap attribute values in the HTML it generates. Like so:
<body class='account signed_out' id='signin'>
Which is perfectly acceptable for any variety of XML, according to the W3C specifications, but is at odds with how the entire internet functions. And it looks a little funny, you know? Luckily, it’s easily changeable.
If you’d rather Haml used double quotes instead of single quotes, just drop the following in your environment.rb:
Haml::Template.options = { :attr_wrapper => %|"| }Or put it in the appropriate initializer, if you’re using Rails 2.
No Comments, Comment
Reply to “On Haml, standards, quotation marks, and looking like everyone else.”