On Dec 27, 2007 8:29 PM, Sam Angove <[EMAIL PROTECTED]> wrote:
>
> It's almost certainly [this][1], in WordPress's MT importer:
>
>         $line = trim($line);
>
> If it's needed at all (for removing trailing newlines?), `rtrim` ought
> to do the job without destroying your codeblocks.
>

Thank you, Sam! Changing

    $line = trim($line)

to

    $line = rtrim($line, "\n")

did the trick. The import will not work at all if the line is
commented out, so apparently getting rid of the newline is necessary.
Since a pair of trailing spaces means <br/> in Markdown, trimming
*all* whitespace from the end of the line is also wrong. (I didn't
notice the missing <br/>s when I posted earlier.)

Tomorrow, when I'm more awake and more likely to write a coherent
message, I'll send off a note regarding this to the WP people, giving
you credit for the fix.

Thanks again,
Dr. Drang
_______________________________________________
Markdown-Discuss mailing list
[email protected]
http://six.pairlist.net/mailman/listinfo/markdown-discuss

Reply via email to