11
0
Files
plasma5-workspace/0003-notifications-Replace-apos-with-as-apos-is-not-suppo.patch

35 lines
1.5 KiB
Diff

From d95c4b850b03776c95efd04baad8c92864c42a3d Mon Sep 17 00:00:00 2001
From: Martin Klapetek <mklapetek@kde.org>
Date: Mon, 27 Apr 2015 14:33:42 +0200
Subject: [PATCH 03/12] [notifications] Replace &apos; with ' as &apos; is not
supported by StyledText
QtQuick's Text with StyledFormat supports only html3.2 subset of stuff.
&apos; is html4 and as such gets removed altogther, which is obviously
unwanted.
Reviewed-by: Kai Uwe Broulik
BUG: 346710
FIXED-IN: 5.3.1
---
dataengines/notifications/notificationsengine.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dataengines/notifications/notificationsengine.cpp b/dataengines/notifications/notificationsengine.cpp
index 6a417294c65c71960f1c1ba022e8c2976a0b9464..37a11dd1f70bc7692112be1d51918a39682969d9 100644
--- a/dataengines/notifications/notificationsengine.cpp
+++ b/dataengines/notifications/notificationsengine.cpp
@@ -232,6 +232,9 @@ uint NotificationsEngine::Notify(const QString &app_name, uint replaces_id,
// text where it finds a stray ampersand.
// Only &{apos, quot, gt, lt, amp}; as well as &#123 character references will be allowed
bodyFinal.replace(QRegularExpression("&(?!(?:apos|quot|[gl]t|amp);|#)"), QLatin1String("&amp;"));
+ // The Text.StyledText format handles only html3.2 stuff and &apos; is html4 stuff
+ // so we need to replace it here otherwise it will not render at all.
+ bodyFinal.replace(QLatin1String("&apos;"), QChar('\''));
Plasma::DataEngine::Data notificationData;
notificationData.insert("id", QString::number(id));
--
2.3.5