[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:22:40 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=53feacc

The following commit has been merged in the master branch:
commit 53feacc687bdd1127396a2eded2f2a2e75d0af5d
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date:   Mon Aug 13 23:46:12 2012 +0200

    Fix regexp and replacement string
---
 filters/formatting/format-filter.cpp | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/filters/formatting/format-filter.cpp b/filters/formatting/format-filter.cpp
index 7e85640..e197aed 100644
--- a/filters/formatting/format-filter.cpp
+++ b/filters/formatting/format-filter.cpp
@@ -57,25 +57,17 @@ void FormatFilter::filterMessage (Message& message)
 
 void FormatFilter::addTag (const char *markingCharacter, char htmlTag)
 {
-    QString pattern = QLatin1String("%1(\S.*\S)%1");
+    QString pattern = QLatin1String("(^|\s)%1(\S|\S.*\S)%1(\s|$)");
     pattern = pattern.arg(QLatin1String(markingCharacter));
 
-    QString repl = QLatin1String("<%1>\1</%1>");
-    repl = repl.arg(htmlTag);
+    QString repl = QLatin1String("\1<%1>%2\2%2</%1>\3");
+    repl = repl.arg(htmlTag).arg(QLatin1String(markingCharacter));
 
     QRegExp exp = QRegExp(pattern);
     exp.setMinimal(true);
 
     d->tags.append(FormatTag(exp, repl));
-
-    QString singleCharPattern = QLatin1String("%1(\S)%1");
-    singleCharPattern = singleCharPattern.arg(QLatin1String(markingCharacter));
-
-    QRegExp singleCharExp = QRegExp(singleCharPattern);
-    singleCharExp.setMinimal(true);
-
-    d->tags.append(FormatTag(singleCharExp, repl));
 }
 
 K_PLUGIN_FACTORY(MessageFilterFactory, registerPlugin<FormatFilter>();)
-K_EXPORT_PLUGIN(MessageFilterFactory("ktptextui_message_filter_formatting"))
\ No newline at end of file
+K_EXPORT_PLUGIN(MessageFilterFactory("ktptextui_message_filter_formatting"))

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list