[wp-trac] [WordPress Trac] #28195: Preview embeds with wpview and auto embed on paste

WordPress Trac noreply at wordpress.org
Tue Jun 10 20:24:27 UTC 2014


#28195: Preview embeds with wpview and auto embed on paste
-------------------------+-------------------------
 Reporter:  avryl        |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.0
Component:  Media        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  javascript
-------------------------+-------------------------

Comment (by avryl):

 I wish it was possible to make a patch for a patch. Would be so much
 clearer. :)

 Anyway, 28195.13.patch adds the following to 28195.12.patch:


 {{{
                 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*$/im
 ) &&
                         ( node.nodeName !== 'P' || node.parentNode !==
 editor.getBody() || ! editor.dom.isEmpty( node ) ) ) {
                         return;
                 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28195#comment:52>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list