Review Request 121296: Escape ampersands in notifications

Mark Gaiser markg85 at gmail.com
Sun Nov 30 21:14:19 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121296/#review71134
-----------------------------------------------------------


This didn't work? http://qt-project.org/doc/qt-5/qstring.html#toHtmlEscaped

- Mark Gaiser


On nov 30, 2014, 8:33 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, 8:33 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/2b4e1319/attachment.html>


More information about the Plasma-devel mailing list