On 20 Oct 2007, at 22:59, Evgeny wrote: > What if I want to do <a><div>...</div></a> -- I just expect it to > work, not to have HAML scream > about it just because inline_tags includes <a>. Question is -- how > will it work?
If you want to do that, you've got bigger problems, because it's not valid HTML. I guess it's arguable that Haml should silently support generating invalid HTML if that's really what you want, but it's equally arguable that you shouldn't expect everything to work just dandy (on the server or in the client) if you decide to break the rules. However, to address the question directly, I guess that option 2 (i.e. format the <a> as if it's a block-level element, even though it isn't) is the prettiest, although it'd be hard to implement because when you're rendering the <a> you don't yet know whether it's going to contain any erroneous block-level content, so I reckon option 1 (i.e. render the <a> inline-style, with the subsequent block-level element formatted oddly) is probably the right way to go if such behaviour is to be supported at all, because it's easier to implement and if you're not interested in your markup being valid you probably not interested in source formatting either. (But then why would you be interested in Haml?) For what it's worth, I'd like to see Haml not support warningless generation of invalid HTML by default, with a vinegary option (:i_dont_care_about_web_standards => true) to enable it. Cheers, -Tom --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/haml?hl=en -~----------~----~----~----~------~----~------~--~---
