Skip to content
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

Convert 100% width Facebook widgets to fixed-height layout #2776

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

westonruter
Copy link
Member

This addresses an issue identified in the AMP plugin forum: https://wordpress.org/support/topic/amp-error-on-facebook-widget-width/

Given input such as:

<div class="fb-comments" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-width="100%" data-numposts="5"></div>

The AMP plugin is currently converting this into:

<amp-facebook-comments layout="responsive" width="100%" height="400" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-numposts="5">

This is an error because AMP does not allow percentage widths. So this PR causes the embed to be output instead as:

<amp-facebook-comments layout="fixed-height" width="auto" height="400" data-href="https://developers.facebook.com/docs/plugins/comments#configurator" data-numposts="5">

This was done elsewhere in #2712. Also related to #2146.

Build for testing: amp.zip (v1.2.1-alpha-20190710T044256Z-4a34c951)

@westonruter westonruter added this to the v1.2.1 milestone Jul 10, 2019
@westonruter westonruter requested a review from swissspidy July 10, 2019 04:49
@googlebot googlebot added the cla: yes Signed the Google CLA label Jul 10, 2019
@swissspidy swissspidy merged commit 2fe6795 into develop Jul 10, 2019
westonruter added a commit that referenced this pull request Jul 11, 2019
…-block-size-validation

* 'develop' of github.com:ampproject/amp-wp: (104 commits)
  Update Miina's WordPress.org username
  Short-circuit the filter for users with necessary caps.
  Fix conversion of CSS selectors when HTML tag maps to multiple… (#2793)
  Add necessary tags for background media.
  Style fixes for upstream updates (#2778)
  Update dependency lodash to v4.17.14 (#2780)
  Add opacity to expected results of tests, too.
  Add opacity to allowed attributes, too.
  Whitelist data-temp-style-hash for all tags.
  Improve filters.
  Convert 100% width Facebook widgets to fixed-height layout (#2776)
  Update dependency @babel/plugin-proposal-object-rest-spread to… (#2774)
  Update dependency lodash to v4.17.13 (#2775)
  Update dependency @babel/core to v7.5.4 (#2773)
  Update dependency @babel/plugin-proposal-object-rest-spread to v7.5.3 (#2772)
  Update dependency postcss-preset-env to v6.7.0 (#2770)
  Remove redundant SKIP_ECHO_PATHS_SCOPE=1 since CHECK_SCOPE=all
  Update dependency @babel/plugin-proposal-object-rest-spread to… (#2768)
  Properly enforce short array syntax using phpcbf
  Enforce short array syntax via PHPCS
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants