3 ms·
Does Haml allow you to control how the actual markup is produced? Some browsers are dependent on a lack of whitespace between nodes in order to render properly
by coderdude 17y ago
Does Haml allow you to control how the actual markup is produced? Some browsers are dependent on a lack of whitespace between nodes in order to render properly without adding some extra padding (IE for instance). For me, the main issue is control over my markup. Exact and precise control, which is necessary.
- chriseppstein 17y agoYou can use the alligator operators to trim surrounding and internal whitespace. E.g. .foo> This has no whitespace outside the foo div. .foo< This has no whitespace just inside the foo div. .foo>< This has no whitespace outside or inside. http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#whitespace_removal__and_ http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#wh...
- coderdude 17y agoIncredible, they even thought of that. I guess Haml isn't so bad after all. Time to check it out.
- jerhinesmith 17y agoHaml does allow for finer-grained control over whitespace, but even if that's not enough, when needed you can still "embed" plain-old html directly inside of your Haml files. I guess I fail to see how html has any advantage over haml. The absolute worst case is that you're still writing html in 90+% of the cases (which you'd be doing anyway without haml), and in the best case, your markup becomes much more DRY and readable.
- jfarmer 17y agoHTML has an advantage because that's what people know, particularly designers. Some designers I've worked with are ok with haml, others steadfastly refuse because their workflow is so HTML-centric.
- chriseppstein 17y agoTool support is a good reason to not use haml. I expect tool support will be there some day, but it's not really there yet. RubyMine has very nice haml support tho.
- ehsanul 17y agoWell, I seem to always have formatting issues with haml, though probably because I haven't worked enough with haml yet to internalize the whitespace rules. No such issues with html of course. Not a huge advantage, but can make it annoying when you're first starting with haml.