Opened 9 years ago
Closed 7 years ago
#40257 closed defect (bug) (wontfix)
TinyMCE wpview: oEmbed previews are not shown if there is only a single line break before the URL
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.4 |
| Component: | TinyMCE | Keywords: | |
| Focuses: | Cc: |
Description
Follow up from Slack: https://wordpress.slack.com/archives/C02QB2JS7/p1490366664439760.
When "embeddable" URLs are separated by only one line break, they work properly in PHP on the front-end but not in wpview in the editor.
To reproduce paste the following in the Text editor then preview the post:
https://www.youtube.com/watch?v=3_uj1kedrNk https://videopress.com/v/zfu4XFD5
It works properly in the preview / on the front-end, but no instances of wpview are created when switching to the Visual editor.
Happens because the PHP version of the regex that finds these URLs is quite different than the JS version. We should standardize it to the PHP version even if that introduces minor regressions (i.e. we show a preview for something that we didn't before), as the "true" functionality is on the front-end, wpview is just previews.
This is now superseded by the block editor. All embeds work much better there.