Review Request 122314: Sanitize whitespace in notification popups
Martin Klapetek
martin.klapetek at gmail.com
Thu Jan 29 23:02:40 UTC 2015
> On Jan. 29, 2015, 10:31 p.m., David Edmundson wrote:
> > dataengines/notifications/notificationsengine.cpp, line 229
> > <https://git.reviewboard.kde.org/r/122314/diff/1/?file=345703#file345703line229>
> >
> > what about if you had
> >
> > \n \n \n
> >
> > I think this will still leave one.
> >
> > Maybe
> > <br/>(\s*|<br/>)*
>
> David Edmundson wrote:
> oh FFS. Reviewboard removed my asterixes.
>
> https://paste.kde.org/plf9yky4o
Ah right, yeah. Actually the asterisk just outside the parenthesis will do. (though that will replace also all single <br/>, not sure how expensive this can be; additionally could be like ```<br/>\s*<br/>(\s|<br/>)*``` ...)
- Martin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/122314/#review75004
-----------------------------------------------------------
On Jan. 29, 2015, 8:14 p.m., Martin Klapetek wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/122314/
> -----------------------------------------------------------
>
> (Updated Jan. 29, 2015, 8:14 p.m.)
>
>
> Review request for Plasma.
>
>
> Bugs: 343532
> https://bugs.kde.org/show_bug.cgi?id=343532
>
>
> Repository: plasma-workspace
>
>
> Description
> -------
>
> While looking into https://bugs.kde.org/show_bug.cgi?id=343532 I noticed that wall sends message always starting with \n, but with our limited space, that makes no sense.
>
> With this patch the text is first trimmed from whitespace at the beginning and end, then all \ns are converted to <br/> (as before), then the text replaces all remaining inner whitespace with single space and finally, if there are two new lines in succession, it turns it into just one.
>
> The bug itself, which is about messages from wall not appearing in the popup, will only partially get solved by this as the popup is limited in max height, so it displays at most 3 lines of text and with wall first two lines are already taken, that leaves just one line for the actual message.
>
> However these are persistant so they get saved in the notification history anyway.
>
>
> Diffs
> -----
>
> dataengines/notifications/notificationsengine.cpp 6e566b4
>
> Diff: https://git.reviewboard.kde.org/r/122314/diff/
>
>
> Testing
> -------
>
> Now I'm able to see the message sent with wall.
>
>
> Thanks,
>
> Martin Klapetek
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20150129/c2c369a8/attachment-0001.html>
More information about the Plasma-devel
mailing list