-
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
The parent tag of tag 'amp-sidebar' is 'amp-bind-macro', but it can only be 'body'. #20368
Comments
I'm also wondering if this is the reason why, when using mobile preview or testing facilities that shows you a screenshot of the site, why it shows all text (html) and not the actual site. |
@AcidRaZor Is I quick try with the following code did not generate any issues for me:
|
I can reproduce this if
@AcidRaZor For a quick work-around, instead of using a self-closing /to @Gregable, looks like there is a parsing issue in parent detection of elements which are after self-closing tags. |
There is no such thing as a self-closing tag in html5. There are about a dozen void elements which have no associated closing tag, but self-closing tag syntax is not a thing. So, a browser (and the amp validator) will see the above example as the same parse tree as:
|
Technically, there are self-closing tags within other namespaces within HTML. The only such namespace allowed by AMP is SVG. This isn't relevant for the question, but to avoid confusion. |
Closing as working as intended. |
I see. I will update the examples then. |
Thanks guys! |
Just as another FYI, I did have the macro's after the amp-sidebar and it still did the same, but the explanation given makes sense. Thanks again for the quick response |
What's the issue?
When using amp-bind-macro, amp-sidebar causes a validation issue with the following error message:
The parent tag of tag 'amp-sidebar' is 'amp-bind-macro', but it can only be 'body'.
How do we reproduce the issue?
I use the following macros to format currency:
What have you used to check?
https://search.google.com/test/amp
https://validator.ampproject.org
Which AMP version is affected?
New issue as far as I am aware, I don't always check validity of the pages I generate, but did notice several months ago that amp-bind-macro wraps everything within the body tag for some reason.
The text was updated successfully, but these errors were encountered: