Bug 86925 - Generated HTML code should use <br> instead of <p>
Summary: Generated HTML code should use <br> instead of <p>
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: 1.10.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 153612 158858 166073 168991 170210 171270 173877 177468 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-10 18:20 UTC by Braden MacDonald
Modified: 2010-05-17 07:44 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Illustration of before-and-after differences (113.45 KB, image/png)
2004-08-10 18:25 UTC, Braden MacDonald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Braden MacDonald 2004-08-10 18:20:23 UTC
Version:           1.7 (using KDE KDE 3.3.0)
Installed from:    Gentoo Packages
OS:                Linux

When I send a mail using KMail's new HTML composer, The message ends up with an extra line break between each paragraph.

For example, in composer I would see:
| Hi Joe,
|  Here is my message.
|
| Regards,
|   Braden

However, once it is sent, it displays like this:
| Hi Joe,
|
|  Here is my message.
|
|
|
| Regards,
|
|   Braden

Here is an exerpt from the source of a real HTML mail I sent:
--Boundary-00=_oLPGBaUgvH7+P4z
Content-Type: text/html;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:12pt;font-family:Sans Serif">
<p>This is the message here</p>
<p></p>
<p>Regards,</p>
<p><span style="font-size:11pt;color:#211f91">_______________________</span></p>
<p><span style="font-size:10pt;font-weight:600;color:#211f91">Braden MacDonald</span></p>
<p><span style="font-size:10pt;font-weight:600;color:#211f91">KTMAFC Webmaster</span></p>
</body></html>

It seems that the "<p>line</p>" should be replaced with "line<br />"

To illustrate I will attach two before and after screenshots.
Comment 1 Braden MacDonald 2004-08-10 18:25:38 UTC
Created attachment 7062 [details]
Illustration of before-and-after differences
Comment 2 Don Sanders 2004-08-17 10:40:47 UTC
Confirmed. I think I already created a patch to address this issue, 
but it was never applied. I want to make sure there isn't a good 
reason why it wasn't applied before I apply it.

Don.

Comment 3 Farliec 2006-05-10 10:32:41 UTC
Kmail Version : 1.9.1 (KDE 3.5.2, Kubuntu Package 4:3.5.2-0ubuntu0 breezy)
Operating System : Linux (i686) release 2.6.12-10-k7
Compiler Target : i486-linux-gnu

Bug open in 2004, still unconfirmed, still not resolved :(
Like bug nĀ°90101.

It seems that KMail's HTML composer doesn't use standard tags : it converts a "break line" (<br> tag) by paragraph tag (<p></p>)

But, like Braden, it's really when the mail is sent : Kmail Composer doesn't show extra lines it makes.

Before Kmail I used Thunderbird, but there was a BIG bug about font size so I decided to replace it by Kmail.

But it's the same problem : How to use a HTML composer that isn't able to show correctly its own HTML code ?

So, now, I don't use HTML composer, I compose my mails in plain text, it isn't very funny :(

Don, where is your patch ?
Comment 4 Farliec 2006-11-04 20:14:28 UTC
Still in KMail 1.9.5

KMail will maybe be able to create correct and valid HTML email in the future...
Comment 5 Farliec 2007-06-16 12:02:05 UTC
Still in Kmail 1.9.7
Comment 6 Thomas McGuire 2007-12-09 15:07:27 UTC
*** Bug 153612 has been marked as a duplicate of this bug. ***
Comment 7 Thomas McGuire 2008-03-10 12:45:36 UTC
*** Bug 158858 has been marked as a duplicate of this bug. ***
Comment 8 Thomas McGuire 2008-03-10 12:49:25 UTC
FYI: The HTML code is actually produced by QTextEdit::toHtml(). I would be the best to fix QTextEdit to produce better HTML, it is really a Qt bug in my opinion.

The other possibility would be to manually iterate over the QTextBlocks in the QTextDocument and build the HTML code yourself.

I think this would be a good junior job.
Comment 9 Allen Winter 2008-03-19 22:44:16 UTC
Thomas,

In the kpimutils library there is at static function
called KPIMUtils::convertToHtml() that might do what you need.

I see for sure that this function converts '\n' into <br>
Comment 10 Thomas McGuire 2008-03-20 08:14:27 UTC
> In the kpimutils library there is at static function called KPIMUtils::convertToHtml() that might do what you need. 

No, that function is unrelated to the textedit. It just converts hyperlinks from plain text into HTML code, nothing else.
Comment 11 Thomas McGuire 2008-07-09 13:53:52 UTC
*** Bug 166073 has been marked as a duplicate of this bug. ***
Comment 12 Thomas McGuire 2008-08-16 16:49:31 UTC
*** Bug 168991 has been marked as a duplicate of this bug. ***
Comment 13 Thomas McGuire 2008-09-02 20:52:58 UTC
*** Bug 170210 has been marked as a duplicate of this bug. ***
Comment 14 Thomas McGuire 2008-09-04 15:59:54 UTC
SVN commit 856724 by tmcguire:

Add hacky workaround to prevent empty paragraphs from disappearing.
CCBUG: 86925
Comment 15 G. Gavranovic 2008-09-11 10:48:58 UTC
For users who can't/wont update to latest SVN version for now: try adding a space to every empty newline till this fix reaches a stable release.
Comment 16 Thomas McGuire 2008-09-18 18:56:06 UTC
*** Bug 171270 has been marked as a duplicate of this bug. ***
Comment 17 Thomas McGuire 2008-11-03 20:13:38 UTC
*** Bug 173877 has been marked as a duplicate of this bug. ***
Comment 18 Jaime Torres 2008-12-11 09:59:19 UTC
*** Bug 177468 has been marked as a duplicate of this bug. ***
Comment 19 Martin Koller 2009-08-26 23:11:34 UTC
In KDE 4.3 this works as mentioned in this bug report (using <br> instead <p>...)
Comment 20 Gregor Petrin 2009-11-09 11:31:18 UTC
This bug is still present on my system: KDE 4.3.1, KMail 1.12.2, QT 4.5 (as far as I can tell).
Comment 21 Jochen 2010-02-11 13:26:30 UTC
Still present on my Systems, too, very annoying.

KDE 4.3.3, QT 4.5.3 and 
KDE 4.3.4, QT 4.5.3
Comment 22 Rich Sezov 2010-04-13 18:56:11 UTC
This is still happening for me on KMail 1.13.2, KDE 4.4.2 on Kubuntu. All my emails look terribly unprofessional because of this. Somebody has got to reopen and fix this bug; it's getting to the point where I want to switch to something else after having used KMail since at least 2000.
Comment 23 Andrew Harley 2010-05-17 07:44:13 UTC
Has been an issue for me for a long time now, can we get this reopened?

KDE 4.4.2, Kmail 1.13.2, Qt 4.6.2

HTML code it generates isn't recognised by clients other than Kmail (Thunderbird/Outlook). Blank lines in particular are a problem.

Going to try out latest development version tonight to see if also occurs there.