Pass amp_is_bento_enabled()
to AMP_Tag_And_Attribute_Sanitizer
as prefer_bento
arg
#6537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given a post that has a Custom HTML block with this content:
Accessing an AMP page (without Bento enabled) will result in v0.1 of the AMP component added to the page (as expected):
When adding this feature flag plugin to enable bento when
?bento
is added to the URL:Accessing the same AMP page with Bento still results in the same script being added as opposed to
amp-facebook
v1.0:With this PR, this is fixed by passing the Bento enabled state to the
AMP_Tag_And_Attribute_Sanitizer
as theprefer_bento
arg. So the resulting page then has:(Note that
amp-facebook-1.0.js
is served rather thanamp-facebook-1.0.mjs
because SSR for Bento is currently broken per ampproject/amphtml#35485, and so SSR is currently disabled when Bento is enabled.)Props @pierlon for recognizing this oversight in #6353 (comment).