[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    [kopete-devel] [RFC PATCH] (4.1.1) kopetemessage.cpp:
From:       Matěj_Laitl <strohel () gmail ! com>
Date:       2008-09-28 13:05:57
Message-ID: 200809281505.57757.strohel () gmail ! com
[Download RAW message or body]

Hello again,
last today's patch adds one more regexp pass into escapedBody() - without 
that, superfluous <p style="..."> and </p> is returned around escaped body, 
causing unneeded newlines in history dialog. It shouldn't add any side effects 
in normal chat window.

Note: I was unable to achieve this by just adding additional fields into 
original regexp, maybe because we need to match start of the document, which 
changes. (also, it didn't work when placed before newline filtering) Someone 
more knowledgeable than me may know slightly more correct solution.

Regards,
	Matěj Laitl

["kopete-parsedbody.patch" (text/x-patch)]

diff --git a/kopete/libkopete/kopetemessage.cpp b/kopete/libkopete/kopetemessage.cpp
index 210bc4f..a9878af 100644
--- a/kopete/libkopete/kopetemessage.cpp
+++ b/kopete/libkopete/kopetemessage.cpp
@@ -326,6 +326,9 @@ QString Message::escapedBody() const
 		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"); +//		remove also the first and last <p> tag, it messes up \
history +		badStuff.setPattern("^<p[^<>]*>|</p>$");
+		html = html.remove (badStuff);
 		d->escapedBody = html;
 		d->escapedBodyDirty = false;
 		return html;



_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic