-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
migrate: Handle single newlines in WordPress comments as line breaks #903
migrate: Handle single newlines in WordPress comments as line breaks #903
Conversation
I haven't touched any javascript in the PR so I don't think the js integration test failures are related. I don't have access to retry the test run, though. |
Hi @projectgus, thank you for your contribution! Especially adding a new test case is really helpful. Re: Inserting a Edit: Please also remove the windows linebreak ( |
@ix5 That's funny, original version of this patch replaced with Also fixed the linebreak, nice catch. I think this was copypasta from the WordPress XML export. Thanks for all your work on Isso, it's very useful. :) |
Looks good, thanks for addressing the review comments. Please also add a |
WordPress renders a single newline in a comment as a <br> tag, but Isso renders a single newline in the comment as a single newline in the HTML. This is rendered the same as if it was a space, all text on one line. To fix, detect single newlines when importing WordPress comments and convert to a line break in Markdown. Add a test for this also. Example, this WordPress comment (as shown in CDATA of XML export): > First line of comment. > Second line of comment. Renders in WordPress as: > First line of comment. > <br> > Second line of comment. But renders in Isso after import as if it was: > First line of comment. Second line of comment. After this commit is applied and comments re-imported, it renders as: > First line of comment. > Second line of comment.
@ix5 Done, and rebased. Thanks! |
Merged. Thank you for your contribution and don't hesitate to submit further PRs! |
WordPress renders a single newline in a comment as a
tag, but Isso renders a single newline in the comment as a single newline in the HTML. This is rendered the same as if it was a space, all text on one line.
To fix, detect single newlines when importing WordPress comments and convert to a line break in Markdown. Add a test for this also.
Example, this WordPress comment (as shown in CDATA of XML export):
Renders in WordPress as:
But renders in Isso after import as if it was:
After this commit is applied and comments re-imported, it renders as:
Checklist
CHANGES.rst
because this is a user-facing change or an important bugfix