Review Request 121296: Escape ampersands in notifications
Martin Klapetek
martin.klapetek at gmail.com
Sun Nov 30 20:32:03 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121296/#review71132
-----------------------------------------------------------
Ship it!
Ship It!
- Martin Klapetek
On Nov. 30, 2014, 9:08 p.m., Kai Uwe Broulik wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121296/
> -----------------------------------------------------------
>
> (Updated Nov. 30, 2014, 9:08 p.m.)
>
>
> Review request for Plasma and Martin Klapetek.
>
>
> Bugs: 341029
> https://bugs.kde.org/show_bug.cgi?id=341029
>
>
> Repository: plasma-workspace
>
>
> Description
> -------
>
> Since notifications now enforce StyledText and due to how QtQuick Text (or QTextDocument for that matter) treat HTML entities, it cuts off text whenever there's a alone & somewhere.
>
> This fancy regexp from [1] keeps " & < > and ' while replacing any other with &. This makes the StyledText enforcement safe for 5.1 imho.
>
> (My impression is that an & triggeres the "look for the semicolon that terminates this entity" which it won't find and then just cut off the text, see QTBUG-33368, in contrast to every webbrowser that just prints these verbatim)
>
> [1] https://stackoverflow.com/questions/16423089/regex-match-ampersand-but-not-escaped-xml-characters
>
>
> Diffs
> -----
>
> dataengines/notifications/notificationsengine.cpp 8bc50e7
>
> Diff: https://git.reviewboard.kde.org/r/121296/diff/
>
>
> Testing
> -------
>
> Deleting "Battery & Brightness" undo notification works as expected and kdialog --passivepopup "test & test & test "test"" works as expected
>
>
> Thanks,
>
> Kai Uwe Broulik
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20141130/4be0c669/attachment.html>
More information about the Plasma-devel
mailing list