Opened 14 years ago
Closed 2 months ago
#16147 closed defect (bug) (reported-upstream)
MT Importer truncates double vertical spaces, munging paragraphs together
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.2.1 |
Component: | Import | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Movable Type 3.x-era exports don't use <p> tags. Like TinyMCE (and WordPress), a <p> in final rendered code is represented by two \ns in a row.
The importer strips out double \ns and replaces with a single \n. This causes paragraphs to lose their distinction upon import.
It does this because the $line variable was created by $line = $this->fgets($handle) (line 339). Then $line = trim($line) (line 340) strips out several characters, including \n.
Lines 455 and 456 add back the \n except on blank lines:
if( !empty($line) ) $line .= "\n";
So if a $line was nothing but a \n, it's stripped by the trim function and becomes a 0 character line. Then the if( !empty($line) ) declines to add back a \n.
Somehow this needs to be altered so that successive \ns aren't stripped. Otherwise paragraphs get vertically munged together.
Attachments (2)
Change History (14)
#2
@
14 years ago
- Resolution set to invalid
- Status changed from new to closed
I think you should post this ticket (and #16148) in the plugins trac instead of core trac.
http://plugins.trac.wordpress.org/newticket
Choose MT Importer from the list of Components.
#4
@
14 years ago
- Milestone set to WordPress.org
- Resolution invalid deleted
- Status changed from closed to reopened
- Version 3.0.4 deleted
This is currently the correct venue for the official importers which were recently moved to plugin repo.
Still needs review to confirm bug.
#5
@
14 years ago
- Version set to 3.2.1
I can confirm that this bug is present in Wordpress 3.2.1. I imported a Movable Type blog which contained sections like the following in the mt-export.txt file :
... ----- BODY: So The Lad sent me another one of my pieces--even from Munich he comes to my rescue. Thanks love. My biggest fear right now is that I might run into the Sicilian on campus somewhere and not have a biting remark ready to hand. If any of you have suggestions, I welcome them. See, I need to keep the scary rage in place because it helps me get out of bed in the morning. ----- ...
The double carriage returns were turned into single carriage returns which causes Wordpress to render each of these as sentences with a <br>
tag at the end instead of paragraphs.
I fixed this by following the suggestions I found here : http://onalark.livejournal.com/192394.html
The comments in this entry that suggest changing the "CONVERT BREAKS" values in the mt-export.txt file are incorrect. This is not needed.
I'm attaching a patch which fixes this bug and worked for me.
#6
follow-up:
↓ 7
@
10 years ago
- Keywords reporter-feedback added
- Severity changed from major to normal
@novasource: Can you verify this still exists?
#7
in reply to:
↑ 6
@
10 years ago
Replying to chriscct7:
@novasource: Can you verify this still exists?
Sorry, this was during a major switch from Movable Type a few years ago. We no longer have Movable Type content to migrate, so I can't test.
#8
@
10 years ago
- Keywords close added; reporter-feedback removed
Yeah, I'm not sure what we're going to do with all these old importer tickets now that none of them are in core anymore. Will mark as close, and ask about this at the next core team irc meetup next week
#9
@
10 years ago
@chriscct7 I can confirm that this problem hasn't been fixed as of
Movable Type and TypePad Importer v0.5-beta which is the upcoming version.
Here is the line that causes the bug :
https://plugins.trac.wordpress.org/browser/movabletype-importer/trunk/movabletype-importer.php#L483
I'll attach an updated patch against the head of the repo. Just gotta get it applied and this bug goes away.
This ticket was mentioned in IRC in #wordpress-dev by chriscct7. View the logs.
10 years ago
#11
@
9 years ago
- Keywords needs-patch added; close removed
Removing the close because it's still valid. Needs patch.
#12
@
2 months ago
- Resolution set to reported-upstream
- Status changed from reopened to closed
The Moveable Type importer now lives on GitHub.
If anyone is still experiencing this issue, please open an issue upstream so it can be addressed appropriately.
Just confirmed that deleting line 455 (
if( !empty($line) )
) fixed everything for me. Now the \n is restored to the end of every line.I could see it being prudent, as a cleanup step, to remove any trailing \ns from the post_content, extended, post_except, post_keywords, and comment_content values for good measure.
Reference http://wordpress.org/support/topic/plugin-movable-type-and-typepad-importer-movable-type-importer-messes-up-line-spacing for a forum post.