! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Suppress unknown markup tags
Status:
RESOLVED: MOVED
Product:
Xfce4-notifyd
Component:
general

Comments

Description Christoph Wickert editbugs 2013-04-23 19:58:50 CEST
xfce4-notifyd supports all markup tags defined in the notification spec (bold, italic, underline, a and img), but unfortunately some programs such as Yakuake or audacious use other HTML tags, too. The spec is not very strict at this point, it just says that *should* never use HTML: "notifications should never take advantage of tags that are not listed above."

Therefor I think that xfce4-notifyd should filter out all tags it doesn't support to not leave the user with messages like "<html> (yakuake started text) </html>"
Comment 1 Christoph Wickert editbugs 2013-04-23 20:00:26 CEST
Adding Nick as QA contact as Brian is not reading his mail anyway.
Comment 2 haarp 2013-09-16 15:16:03 CEST
Yeah, any kind of brackets in the message body seem to break notifyd.

notify-send "Title" "Five < Six"

This will fail to show the body.
Comment 3 Simon Steinbeiss editbugs 2016-07-08 22:37:44 CEST
*** Bug 11706 has been marked as a duplicate of this bug. ***
Comment 4 Simon Steinbeiss editbugs 2016-07-09 00:03:34 CEST
Just for the sake of completeness: xfce4-notifyd does nothing special about HTML entities or tags, it basically only supports Pango markup (which is what Gtk itself comes with: https://developer.gnome.org/pango/stable/PangoMarkupFormat.html)
So you can use those tags there and in addition some stuff like \n to produce newlines.

There are no HTML parsers in c (or glib) around which I know of and I don't plan to implement one myself, so unless someone else steps up to do this, this issue will remain open.

Also note that xfce4-notifyd (or actually Gtk+) informs you of the error with a warning (using the code from the duplicate bug as example):

(xfce4-notifyd:8039): Gtk-WARNING **: Failed to set text 'hello <br> this will not be shown' from markup due to error parsing markup: Error on line 1 char 50: Element 'markup' was closed, but the currently open element is 'br'
Comment 5 Denis Veduta 2017-08-14 00:16:31 CEST
Maybe this example of workaround could help:
https://github.com/GNOME/notification-daemon/commit/620c53fc9cec4ac4ed79754c71429be9db4a7a77
Comment 6 Git Bot editbugs 2017-08-14 23:21:01 CEST
Simon Steinbeiss referenced this bugreport in commit 8265b411339a390768f2c94f2bc2e0f9983da04b

Fix empty body when markup is invalid (Bug #10027)

https://git.xfce.org/apps/xfce4-notifyd/commit?id=8265b411339a390768f2c94f2bc2e0f9983da04b
Comment 7 Simon Steinbeiss editbugs 2017-08-14 23:23:20 CEST
Thanks, nice find!
So this at least means that the message body won't be empty with examples like the one mentioned by haarp.

Unfortunately this doesn't fix the OP's issue wrt html tags.
Comment 8 Git Bot editbugs 2020-05-24 20:04:08 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/xfce4-notifyd/-/issues/1.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #10027

Reported by:
Christoph Wickert
Reported on: 2013-04-23
Last modified on: 2020-05-24
Duplicates (1):
  • 11706 Desktop notifications break if they contain

People

Assignee:
Simon Steinbeiss
CC List:
5 users

Version

Attachments

Additional information