Opened 10 years ago
Closed 10 years ago
#29686 closed defect (bug) (fixed)
Annoying oEmbed keep show
Reported by: | rajlaksh | Owned by: | |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Attachments (1)
Change History (19)
#2
@
10 years ago
Confirmed, and it's not limited to http://google.com
.
If I paste any URL into TinyMCE, it's displayed as an oEmbed view for a couple of seconds.
#4
@
10 years ago
Yes, I think there's a ticket for this somewhere. To fix this, we need to change how views are loaded in the editor.
However, I don't think we disable the oEmbed views if the filter is removed.
This ticket was mentioned in IRC in #wordpress-dev by johnbillion. View the logs.
10 years ago
#8
@
10 years ago
Looks like the solution to this particular problem is pasting into an existing line - or pasting into anywhere that is not a new p tag.
I'm seeing the exact opposite problem in that when you paste a youtube url into the editor in 4.1, it seems it will only ever turn into an embed if it happens to be pasted on a blank paragraph.
If you're using forced_root_block=div mce option, or even just have started with
<div>text</div>
on a post, it seems you can never insert embed by pasting a url, or pasting url on a new line.
#9
@
10 years ago
It looks like this is expected behavior according to the source in wp-includes/js/tinymce/plugins/wpview/plugin.js:
No explanation is given in the code as to why it must be in an empty p tag
// When the editor's content changes, scan the new content for // matching view patterns, and transform the matches into // view wrappers. editor.on( 'BeforeSetContent', function( event ) { var node; if ( ! event.content ) { return; } if ( selected ) { removeView( selected ); } node = editor.selection.getNode(); // When a url is pasted, only try to embed it when pasted in an empty paragrapgh. if ( event.content.match( /^\s*(https?:\/\/[^\s"]+)\s*$/i ) && ( node.nodeName !== 'P' || node.parentNode !== editor.getBody() || ! editor.dom.isEmpty( node ) ) ) { return; } event.content = wp.mce.views.toViews( event.content ); });
#11
@
10 years ago
Won 4.1 version is out without fixing it.
I'm waiting for Offical release with fixed it. But Newer Version keep coming. If it will not gonna fixed i have to Remove oEmbed from WP Mannual so it will not annoy me.
This ticket was mentioned in IRC in #wordpress-dev by rajlaksh. View the logs.
10 years ago
#17
@
10 years ago
- Component changed from Editor to Embeds
- Focuses javascript administration removed
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.2
Not sure if this is a good fix, but it works.
Something to look out for here is widgets...
#18
@
10 years ago
- Resolution set to fixed
- Status changed from new to closed
The problem reported here was fixed in #31412. When pasting a non-embeddable URL in an empty paragraph in the editor, we wait for the embed check to return before converting it to a wpView.
As to completely disabling this feature (embed when pasting embeddable URL), we can make that easier by adding a filter, perhaps in wp_ajax_parse_embed()
. This enhancement will need a new ticket :)
Fixed in [31546].
I'm using this filter
still it showing.