! 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 !
GTK logs warning when non-markup notification body contains markup characters


Description Tiit Pikma 2018-05-22 14:46:53 CEST
Commit 6d178157e49ba60dddf08857950904f43a56dcd6 introduced an annoyance. Any
non-markup notification bodies containing markup characters (e.g., ampersand)
are still displayed correctly, but are now accompanied with a syslog message:

Failed to set text '&' from markup due to error parsing markup: Viga real 1: Olem ei lõppenud semikooloniga; kõige tõenäolisemalt ei kavatsenud sa ampersandi kasutades olemit alustada - märgi see kui &

(The Estonian part just says that the ampersand was not part of a correct entity.)

This is because before gtk_label_set_markup was only done after ensuring that
the body contains markup. Now it is done speculatively, resulting in the log
message when parsing fails.

Steps to reproduce:
1. notify-send test '&'
2. Check syslog.

Actual results:
The notification is displayed, but a warning is logged.

Expected results:
The notification is displayed and no warning is logged.
Comment 1 Simon Steinbeiss editbugs 2018-08-26 21:15:10 CEST
The problem is the following: GtkLabel supports more markup than Pango and there is no other test for seeing whether a certain markup can be displayed in a GtkLabel than by just setting the markup and checking if the label is not empty (that's what I do now).

Before only Pango markup was allowed, so a lot of html entities that would actually display fine were simply ignored, so a lot of notification body text was lost.

I'm not sure how else to ensure everything that can be rendered in a GtkLabel is actually shown - so I'm really not sure how to fix this.
Maybe the warning message can be suppressed somehow with a macro, I'll take a look.
Comment 2 Simon Steinbeiss editbugs 2018-08-26 22:05:26 CEST
Sorry, I looked and asked around but there seems to be no way to prevent these warnings from being printed, so as long as I - or anyone else - don't find a method to check what can be rendered by a GtkLabel I'll have to leave things as they are.
Comment 3 Tiit Pikma 2018-08-27 09:39:40 CEST
Understood. Luckily I can just have logcheck ignore those lines. Thank you for looking into it.
Comment 4 Simon Steinbeiss editbugs 2018-08-27 23:45:36 CEST
That's probably the best solution for now. If you could add a short howto here I could copy it to an FAQ in the documentation (others may also run into this problem): https://docs.xfce.org/apps/notifyd/start
Comment 5 Tiit Pikma 2018-08-29 11:25:42 CEST
To suppress logcheck from reporting these log lines, put the following in /etc/logcheck/ignore.d.workspace/xfce4-notifyd (creating it if necessary):

^\w{3} [ :0-9]{11} [._[:alnum:]-]+ xfce4-notifyd\[[0-9]+\]: Failed to set text '.+' from markup due to error parsing markup: .+$
Comment 6 Simon Steinbeiss editbugs 2018-08-29 21:25:15 CEST
Thanks, noted here now: https://docs.xfce.org/apps/notifyd/faq

Bug #14414

Reported by:
Tiit Pikma
Reported on: 2018-05-22
Last modified on: 2018-08-29


Simon Steinbeiss
CC List:
0 users



Additional information