Skip to content

Prevent validation error for WordPress.tv embed in Classic Editor#4164

Merged
westonruter merged 1 commit intodevelopfrom
fix/wordpress-tv-classic
Jan 22, 2020
Merged

Prevent validation error for WordPress.tv embed in Classic Editor#4164
westonruter merged 1 commit intodevelopfrom
fix/wordpress-tv-classic

Conversation

@kienstra
Copy link
Copy Markdown
Contributor

@kienstra kienstra commented Jan 22, 2020

Summary

In the classic editor, this prevents a validation error from a <script> appearing in the WordPress.tv oEmbed markup.

As Weston mentioned, the previous 'render_block' filter only applied to the WordPress.tv block.

But this embed can be in the Classic Editor, or in a Custom HTML block in the block editor.

This uses the suggested 'embed_oembed_html' filter instead, which handles these cases without a validation error:

Classic Editor

tv-classic-editor

Block Editor

custom-html

Fixes #4130

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

As Weston pointed out,
it's still possible to have this embed in the classic editor.
@googlebot googlebot added the cla: yes Signed the Google CLA label Jan 22, 2020
@westonruter westonruter added this to the v1.4.3 milestone Jan 22, 2020
@westonruter westonruter changed the title [WIP] Prevent validation error for WordPress.tv embed in Classic Editor Prevent validation error for WordPress.tv embed in Classic Editor Jan 22, 2020
@kienstra
Copy link
Copy Markdown
Contributor Author

Thanks, sorry for not removing the [WIP] after you mentioned this.

@westonruter westonruter merged commit 7f15936 into develop Jan 22, 2020
@westonruter westonruter deleted the fix/wordpress-tv-classic branch January 22, 2020 17:37
westonruter pushed a commit that referenced this pull request Jan 22, 2020
…4164)

As Weston pointed out,
it's still possible to have this embed in the classic editor.
westonruter added a commit that referenced this pull request Jan 24, 2020
…ued-dependency-sourcing

* 'develop' of github.com:ampproject/amp-wp: (42 commits)
  Use static closure since $this is not needed
  Revert change in some tests, as they're not needed anymore
  Use suggested normalization, update tests
  Add a new method to normalize URLs
  Remove test case that is no longer handled
  Move urldecode() lower in the function
  Revert change to regex, in favor of trimming before it's passed
  Fix some phpcs errors, mainly => alignment
  Align => operators, from a recent commit
  Add a since tag to the new filter amp_to_amp_excluded_urls
  Commit Weston's suggestion to prevent conditional in Standard mode
  Handle case of something like #heading at end of URL
  Rename parameter 'excluded_amp_links' to 'excluded_urls'
  Change filter name to 'amp_to_amp_excluded_urls'
  Change DocBlock of 'amp_to_amp_excluded_links'
  As there's now a capturing group, remove lookahead
  Replace 2 calls of trim() with longer regex in parse_protocol()
  Commit Weston's suggestion for the Reader mode template
  Allow a URL to have a leading space without a validation error
  For WordPress.tv embed, Use an oembed filter instead of block filter (#4164)
  ...
westonruter added a commit that referenced this pull request Feb 13, 2020
* tag '1.4.3': (22 commits)
  Update readme and screenshots for Stories removal (#4259)
  Open story export instructions in a new window (#4258)
  Bump version to 1.4.3-RC1
  Hide Stories options and add deprecation notice (#4219)
  Fix malformed conversion of relative action URLs for forms (#4250)
  Limit Stories experience to WP 5.3 & Gutenberg 7.1.0 (#4217)
  Prevent errors in admin bar filters from non-array arguments (#4207)
  Update @wordpress/e2e-test-utils dependency
  Revert update of mustache/mustache dependency
  Update composer.lock
  Update WP CLI to 2.4.0
  For WordPress.tv embed, Use an oembed filter instead of block filter (#4164)
  Update readme to add FAQs section (#4159)
  Apply workaround to fix test__multiple_valid_image_files (#4034)
  Ignore Story editor tests (#4043)
  Update amp-video embed regex pattern to include other Vimeo URL formats (#4051)
  Update amp-instagram embed regex (#4053)
  Update wp-dev-lib package (#4029)
  Fix conversion of forms with relative action URLs (#4003)
  Improve release instructions (#3995)
  ...
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.

WordPress TV embeds in Classic Editor result in validation error

3 participants