[Kde-pim] asCleanHtml, and thoughts towards html replies to html emails

Stephen Kelly steveire at gmail.com
Wed Sep 17 13:15:46 BST 2008


Thomas McGuire wrote:
> Just a couple of comments (most of which I already said on IRC I think)
> 
> 1) I don't think all those e-mail specific classes are necessary. For
> inline images/attachments, we probably only need a MailBuilder which
> inherits HTMLBuilder, and simply converts the image/attachment to a link.
> The quoting stuff IMHO doesn't belong into the builder at all, currently
> quote handling is done in keyPressEvent() in KMeditor, and highlighting
> with KEMailQuotingHighlighter. Unless I missed something, that pretty much
> covers quoting.

Yeah, you're probably right about that.

> 
> 2) In the end, unit tests which verify that the produced HTML code is the
> expected output would be nice.

I've just checked in the first unit test. I'll do more in a week.

> 
> 3) An empty line produces two lines in the re-rendered box, one empty, and
> one with a single space.

I filed a qt bug on that
http://trolltech.com/developer/task-tracker/index_html?id=227495&method=entry

> 
> 4) Are the "style="margin-top:0;margin-bottom:0" attributes in the p tags
> really necessary?

I'll look into that more. Ideally they wouldn't be there. I'd like to get
more thoughts and requirements from people on how clean html should look
like.

> 
> 5) Just out of interest: Why is changing the font size done by <span
> style="font-size:16pt;"> instead of a plain <font size="16">?

deprecated as Ingo said.

> 6) Do we really need manual <u> and <span> tags for links? Isn't <a>
> enough?

I think it would be very messy to try and remove them, because of how the
html is generated. They don't cause any major problems and formatting of
the text would be neccessary anyway if links were styled any differently
than blue+underline.
 
> As we said on IRC about the virtuals: Just add a virtual
> beginSpecial/endSpecial with an enum as parameter, that can be extended
> easily in the future (for example for tables)

I added a

   virtual void beginExtraElement(int, QVariantList) { }

Hopefully that'll take care of everything.

>> Files for kdepim (don't work at all. Mostly a braindump):
>> emailmarkupdirector              -- markupdirector with support for
>> quotes,
>>                                     attachments etc
>> abstractemailbuilder             -- builder with support for quotes, etc
> 
> I don't get the point about the quotes, what are you trying to do here?

Trying to make it so that quote blocks when html replying would be
surrounded by <blockquote>. Not sure if it's the correct approach, so I'll
drop it 
for now.

> 
>> richemailbuilder                 -- multiply inherited htmlbuilder (for
>>                                     html building implementation) and
>>                                     abstractemailbuilder. To be used to
>>                                     create html replies to html emails
> 
> Creating HTML replies to HTML mails is something that would likely need
> some modifications in KMail (KMMessage::createReply(), the template parser
> and the objecttreeparser). I don't see why this class would be needed.

OK. I'll be looking more into this stuff in a few weeks.

> 
>> One major issue I see with html replies to html emails is that non-kmail
>> clients will send html that qtextedit doesn't know how to handle. That
>> might take some work to manipulate foreign emails into a format usable to
>> kmail.
> 
> Doesn't QTextEdit already deal with that, e.g. simply ignoring all the
> stuff it doesn't understand?

Yes, but it doesn't understand some tags that may come in, like <strike>
instead of <s> etc. There are other possible examples, but I don't remember
any right now.

> 
> Thanks for your great effort.

Cheers, 

Steve.

> 
> Regards,
> Thomas


_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list