[wp-trac] [WordPress Trac] #11144: WP importer strips whitespace at EOL, problem with Markdown

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 3 08:24:52 UTC 2010


#11144: WP importer strips whitespace at EOL, problem with Markdown
--------------------------+-------------------------------------------------
 Reporter:  demetris      |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  3.0        
Component:  Import        |     Version:  2.9        
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------

Comment(by dwright):

 I see, thanks for the attachment demetris.

 My tests were importing 'posts', not 'pages'. (it's a different process
 code-wise)

 Here is a patch which will work for either. It's not the greatest patch
 but is very conservative, only effecting '<content:encoded>'.

 Denis, possibly that is true, I wanted to keep the patch as conservative
 as possible, so I left in trim (removing spaces and newline's for content
 only).

 In this new patch (for page imports, the 'rtrim($importline,
 "\n\r\0\x0B");' is crucial. RE: '$this->post .= $importline . "\n";'
 affix's a newline to content. (so if rtrim is removed, the content would
 have double line breaks, as demetris originally found out.)

 Note, I didn't run the WP test suite.

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


More information about the wp-trac mailing list