Bug 389323

Summary: Notifications not displayed correctly when message contains <
Product: [Plasma] plasmashell Reporter: Lastique <andysem>
Component: NotificationsAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: normal CC: nate, plasma-bugs
Priority: NOR    
Version: 5.10.5   
Target Milestone: 1.0   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Lastique 2018-01-22 18:59:38 UTC
Try executing the following command:

notify-send "abcd <z efgh"

The displayed notification will only include "abcd" part. It looks like the notification is interpreted somehow (possibly as HTML or XML) while it is expected to be plain text to be reproduced as is.

This affects applications such as Thunderbird, which may display new email notifications where the message contains email title, which can have special characters like "<".
Comment 1 Kai Uwe Broulik 2018-01-23 08:41:25 UTC
Notification server provides the "body-markup" capability which means notifications must be HTML-escaped.
Comment 2 Lastique 2018-01-23 09:50:09 UTC
Is this "body-markup" a KDE-specific feature (i.e. not mandated by the underlying protocol or specification)? If so, I think applications cannot be expected to perform escaping, certainly not non-KDE ones.
Comment 3 Kai Uwe Broulik 2018-01-23 10:15:30 UTC
No, it is part of the freedesktop notification specification also used by others, such as Gnome. A server has to query the capabilities of the server before using it, cf.:

qdbus org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.GetCapabilities

Google Chrome as a non-KDE application does, for instance, and will escape when "body-markup" is present, or send plain-text if not. Please file a bug report against the offending application.
Comment 4 Lastique 2018-01-23 10:21:16 UTC
I see. Thanks for the clarification.