bminer / node-blade

Blade - HTML Template Compiler, inspired by Jade & Haml
Other
320 stars 28 forks source link

<option value=""> #187

Closed braco closed 10 years ago

braco commented 10 years ago

value="" is dropped when empty, but empty is valid and important for some applications.

bminer commented 10 years ago

@braco - Interesting. Could you please provide an example or two for when value="" might be valid?

braco commented 10 years ago

Angular in this case can be provided a blank value to invalidate the first option. There can be many other reasons, the template language shouldn't act as a barrier to desired output.

bminer commented 10 years ago

I agree. This is definitely a bug. Thanks!

braco commented 10 years ago

Cool, thanks.

Similarly, div(foo) should produce <div foo /> and not <div foo="foo" />

bminer commented 10 years ago

@braco - You're welcome.

Regarding your most recent request about Boolean HTML attributes... I'm going to disagree with you on that one. Some browsers don't understand what <input disabled /> means; they only understand <input disabled="disabled" />

So, mostly for backwards compatibility, Blade renders input(disabled) as <input disabled="disabled" />. I can't think of a use-case where you would really want <input disabled /> other than saving a few bytes of bandwidth.

Anyway, I could be wrong, and I'd be open to discussing this. What are your thoughts?