Strip hard-wrapping newlines from e-mail only if it's actually e-mail
Bug #3148 reported by
Matthew Paul Thomas
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Invalid
|
Medium
|
Unassigned |
Bug Description
Currently fmt:text-to-html ignores a line break if the line is between 60 and 80 characters and there is text on the next line, on the assumption that it is hard-wrapped e-mail. This occasionally causes false positives with tracebacks and the like.
But if I'm entering stuff in a Web form, there's no point doing this; Launchpad knows very well that it's not getting the text from an e-mail message. So the linebreak-ignoring code should be removed from fmt:text-to-html, and instead put in the Malone code that extracts text from an incoming e-mail message.
Credit to Daniel Holbach for this idea.
Changed in launchpad: | |
status: | New → Accepted |
To post a comment you must log in.
It's not that simple, though. Just because an e-mail is hard wrapped, it doesn't mean that the e-mail client automatically wrapped it. Often they are manually wrapped, just like you can do in the web interface.
At the moment fmt:text-to-html displays comments sent via e-mail poorly, but they are displayed nicely in the notification e-mails that get sent out. If you would move the linebreak-ignoring code outside fmt:text-to-html as you suggested, that would result in both fmt:text-to-html and the notification e-mails would display e-mail comments poorly...
We have to come up with some other way to fix fmt:text-to-html, I've fixed the outgoing e-mail formatting once, I'm not going to like a solution that causes a regression there.