• I have Movable Type and TypePad Importer 0.4. My MT export file has double vertical spaces between each paragraph. For example:

    Paragraph 1.
    
    Paragraph 2.
    
    Paragraph 3.

    When this importer imports the data, it converts everything to single spacing:

    Paragraph 1.
    Paragraph 2.
    Paragraph 3.

    I noticed this on the rendered output, and I double-checked by loading an importing blog entry in the editor and clicking on the HTML tab.

    Why is that, and how do I stop it?

    http://wordpress.org/extend/plugins/movabletype-importer/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Aren Cambre

    (@novasource)

    Further inspection shows that it’s just scooping up the content verbatim and shoving it into WordPress via wp_insert_post.

    I went straight to the mysql database to look at the post_content field directly, and the vertical spacing has indeed been collapsed.

    Thread Starter Aren Cambre

    (@novasource)

    I think I found it. Lines 455 and 456:

    <?php
       if( !empty($line) )
       $line .= "\n";
    ?>

    At this point, the script is processing the inside of a field. $line was set in line 340 with $line = trim($line);, which per http://php.net/manual/en/function.trim.php would have stripped off the \n. So a line that was originally nothing other than \n is now blank when it hits line 455, and because of if( !empty($line) )

    In a nutshell, if the line was only \n, that \n was stripped and is not added back. Hence double vertical spaces are being collapsed into single vertical spaces.

    Thread Starter Aren Cambre

    (@novasource)

    Ok, just want to confirm that deleting line 455 (if( !empty($line) )) fixed everything for me. Now line 456 ($line .= "\n";) is executed every time, and paragraphs aren’t munged together.

    This may add an extraneous \n to the end of certain variables. This might need to be cleaned elsewhere?

    Submitted bug report: http://core.trac.wordpress.org/ticket/16147

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Movable Type and TypePad Importer] Movable Type importer messes up line spacing’ is closed to new replies.