Review Request: Add HTML entity resolving to KNotify's XML-based HTML stripper

Sjors Gielen dazjorz at
Thu Sep 2 00:07:30 BST 2010

This is an automatically generated e-mail. To reply, visit:

Review request for kdelibs and Olivier Goffart.


This patch adds HTML entity resolving.
The HTML stripper that I previously patched in KNotify is actually an XML stripper; this is not much of a problem except many HTML entities like   are not valid in XML, making the parser fail; this has the effect that a message from an application with one such entity in it, is displayed as plain HTML, instead of the stripped message.
This patch adds a HtmlEntityResolver class and makes the XML stripper use it to resolve additional entities. The   which would have caused an XML error, is now turned into a regular space, fixing the problem. (Any unknown HTML entities are currently replaced with an empty string.)

I placed HtmlEntityResolver inside NotifyByPopup because it is such a small class, but if I am going to add *all* HTML entities (there's a lot of them), I think it would be best to split the file off into its own class (unless there's a better class to use for this).

I think this patch should be backported to KDE 4.5 because it fixes an important bug.


  /trunk/KDE/kdebase/runtime/knotify/notifybypopup.h 1170746 
  /trunk/KDE/kdebase/runtime/knotify/notifybypopup.cpp 1170746 



Compiles and works on Mac OS X (tested with the Growl patch in 4.6 trunk). Only tested with  , not with other HTML entities, or a mix of HTML and XML entities.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list