[wp-trac] Re: [WordPress Trac] #5678: Respectfully strip newlines in some importers

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 18 02:32:32 GMT 2008

#5678: Respectfully strip newlines in some importers
 Reporter:  jdub                  |        Owner:  hansengel
     Type:  enhancement           |       Status:  assigned 
 Priority:  normal                |    Milestone:  2.5      
Component:  General               |      Version:  2.5      
 Severity:  normal                |   Resolution:           
 Keywords:  needs-patch has-docs  |  
Comment (by jdub):

 Unfortunately, you've just simplified it slightly too much. :-)

 The element whitespace smarts was pretty crucial to why I wrote the
 function, given that the input can look like this:

 <p>This is a paragraph in which the
 wpautop() <a href="#elsewhere">wrapping will
 happen in the middle</a> of an
 anchor, which is an inline element.</p>

 But at the same time, we wouldn't want
 the newlines to be removed from within
 a block element such as a <pre>.

 With element whitespace smarts, the newlines in the middle of the
 {{{<p>}}} will be removed (so as not to be replaced with a {{{<br/>}}}
 during {{{wpautop()}}}, but those within the {{{<pre>}}} will not.

 I'll write up another simplified patch that keeps this (and will also
 include using this function in other HTML-consuming importers).

 Thanks. :-)

Ticket URL: <http://trac.wordpress.org/ticket/5678#comment:10>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list