Skip to content

Embeds after breaks are broken #11691

@trepmal

Description

@trepmal

Describe the bug
Embeddable URLs after single line breaks stop working

To Reproduce
Create a post from classic editor/pre-gutenberg with content:

Some text above
https://www.youtube.com/watch?v=3V9QHBgrPNY

https://www.youtube.com/watch?v=f5KyMNDJE6o

View it

Expected behavior
Two embedded videos

Screenshots
(can get if needed)

Actual behavior
One plain URL and one video

Cause

https://github.com/WordPress/gutenberg/blob/master/lib/compat.php#L117 runs before https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-embed.php#L32

markup added by wpautop prevents regex from matching

Desktop (please complete the following information):

  • OS: MacOS Mojave
  • Browser Firefox
  • Version 63.0.1

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

  • Gutenberg version: master branch
  • WP Version: 4.9.8

Metadata

Metadata

Assignees

Labels

Backwards CompatibilityIssues or PRs that impact backwards compatability[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions