-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amp-bind: XHTML-friendly syntax #11115
Comments
@choumx We use JavaScript as part of our build process, and the square brackets have caused some headaches. We've resorted to using work-arounds to set the square bracket amp-bind attributes on page elements, which is not the best. |
This issue hasn't been updated in awhile. @choumx Do you have any updates? |
Sorry for the delay on this! A lot of things got in the way. We're super happy to accept PRs from external contributors too. 😉 |
Also: the bracketed syntax makes it difficult to generate AMP bound attributes with JSX (e.g. via React). |
Simply allowing a |
@choumx I have a proposal for adding such support for To copy here for reference:
Such |
Sounds good. The only thing we'd need to decide is how to toggle |
I notice that |
(Also, maybe |
IMO |
Could the parser when it comes across In regards to validation, I think there'd still need to be something in place or else someone could throw on |
Absolutely, we have I still think we should use an |
My concern about |
Oh interesting. So CMS's often stitch together fragments of HTML (e.g. template + UGC) to form an AMP page? Isn't there a risk that the result won't pass the AMP Validator? |
Yes and yes 😄 But let's just say that the various modules/plugins of a CMS are validating that the markup they're contributing is valid AMP… it would complicate things if they also had to communicate to each other that one specific syntax of |
…9835) * Add docs for XML-compatible binding attribute syntax See ampproject#11115 and ampproject#15408 * Minor edits
Square brackets, e.g
[foo]
, are not valid attribute name starting chars in XML spec: https://www.w3.org/TR/REC-xml/#NT-NameStartCharPerhaps we can allow a configuration to switch to an alternative syntax, e.g.
The text was updated successfully, but these errors were encountered: