[wp-trac] [WordPress Trac] #25387: Autoembeds don't work with paragraphs

WordPress Trac noreply at wordpress.org
Fri Jan 31 23:11:16 UTC 2014


#25387: Autoembeds don't work with paragraphs
--------------------------+--------------------
 Reporter:  Looimaster    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  Embeds        |     Version:  3.6.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+--------------------

Comment (by seanchayes):

 This is my first punt at regex and I have attached a patch and a
 screenshot with the content I tested against.

 In essence I started by working from redsweaters regex, found I kept
 getting an error when I was testing and I just couldn't deduce why. This
 is what I got:

 {{{preg_replace_callback(): Unknown modifier '(' ...}}}

 So, I modified the original regex and it's in the patch and here:

 {{{ |(?<!")(https?://[^\s"\[<]+)|im }}}

 Along the way I did fairly basic testing with YouTube, Vimeo, WordPress.tv
 and Slideshare urls spread about some content (within tags and anchors as
 well as on separate lines and within embeds) I crafted to identify where a
 url was successfully parsed and embedded vs left alone.

 Long story short, based on my testing, I could resolve the issue reported
 in this ticket, but I expect more testing is required to cover more
 scenarios and perhaps someone with a little more experience (and time)
 with regex might offer guidance on the pattern used.

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


More information about the wp-trac mailing list