[wp-trac] [WordPress Trac] #23776: A string of text starting with "http://" turned into a paragraph

WordPress Trac noreply at wordpress.org
Mon Jul 29 23:32:31 UTC 2013


#23776: A string of text starting with "http://" turned into a paragraph
--------------------------+------------------------------
 Reporter:  winterstreet  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Embeds        |     Version:  2.9
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by Viper007Bond):

 It is a bug. :)

 The intention of the embed code is to find a URL on its own line. Once
 found, it tries to embed it and if it is unable to, then it hyperlinks the
 URL. However the number of line breaks during this whole process should
 remain the same.

 `WP_Embed::autoembed_callback()` returns new lines before and after the
 string it returns because those new lines are matched as a part of the
 search process.

 So really the more proper solution is likely to fix the regex to find URLs
 on their own line but not include the line breaks in the match so that the
 function that returns the result won't need to include them, potentially
 including extra line breaks in the process.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/23776#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list