googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

Conditional attribute syntax does not blend well with standards #206

Closed lloeki closed 9 years ago

lloeki commented 9 years ago

While the conditional attribute syntax is neat, it does not blend well with standards, and makes tooling such as linters, syntax highlighters and code generators angry to varying degrees. Save for this special case, the template binding syntax appears standard to me.

I would like to discuss the possibility of having an alternate syntax that does not clash with the HTML spec, by making the conditional thingy syntactically part of the attribute value. Examples:

<x-foo hidden="?{{ foo }}"></x-foo>
<x-foo hidden="{{? foo }}"></x-foo>
lloeki commented 9 years ago

Scratch that, I misread the spec. Now I get it that x-foo?=bar makes the quotation mark part of the attribute name. Sorry for the noise, I'll be pestering non-compliant tools instead :-)