Maybe the patch...
On Thursday 15 May 2008 12:28:06 Detlev Casanova wrote:
> Hello,
> Here's a patch correcting the problem of end of line not shown in the
> message part when sending a message wich contains several lines.
>
> The KRichTextEditPart::text() method returns the text in paragraphs instead
> of putting <br /> at the end of lines when it is asked to return rich text.
> When the message was escaped ( Message::escapedBody() ) , all <p> and </p>
> tags were removed, that's why the text was wrongly shown in the message
> part (plain text is send to the contact so no problem there).
>
> I simply removed the suppression of these paragraphs so it is shown right
> in the message part.
>
> Another solution would be to remove the open tag (<p*>) and replace the
> close tag (</p>) by a new line tag (<br />) so it is *really* escaped.
>
> It works now with paragraphs so... "If it's not broken, don't fix it" :p



-- 
Detlev Casanova
Student at the Université de Liège (computer science)
Open source project : Kapture ( http://kapture.berlios.de/ )
Google Summer of Code 2008 student.
Index: libkopete/kopetemessage.cpp
===================================================================
--- libkopete/kopetemessage.cpp	(revision 807746)
+++ libkopete/kopetemessage.cpp	(working copy)
@@ -322,7 +322,7 @@
 
 //		all this regex business is to take off the outer HTML document provided by QTextDocument
 //		remove the head
-		QRegExp badStuff ("<![^<>]*>|<head[^<>]*>.*</head[^<>]*>|</?html[^<>]*>|</?body[^<>]*>|</?p[^<>]*>");
+		QRegExp badStuff ("<![^<>]*>|<head[^<>]*>.*</head[^<>]*>|</?html[^<>]*>|</?body[^<>]*>");
 		html = html.remove (badStuff);
 //		remove newlines that may be present, since they end up being displayed in the chat window. real newlines are represented with <br>, so we know \n's are meaningless
 		html = html.remove ("\n");

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
kopete-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kopete-devel

Reply via email to