Closed ptrcnull closed 2 years ago
It only supports Pango Markup. "
Could you post an IRC example? :)
irc messages (sometimes) get sent as notifications with the equivalent of notify-send "buffer/networkname" "<ircuser> message"
, so the message contents look like an open html tag
if that irc user is also named small
and ends their message with \</small>, then it would ensmallen the notification text :)
irc messages (sometimes) get sent as notifications with the equivalent of
notify-send "buffer/networkname" "<ircuser> message"
, so the message contents look like an open html tagif that irc user is also named
small
and ends their message with , then it would ensmallen the notification text :)
Well that's inconvenient... I'll look into this
there's a similar thing happening with spotify songs that have &
in them:
(swaync:20712): Gtk-WARNING **: 02:52:23.916: Failed to set text 'Futurecop! - The Unicorn & the Lost City of Alvograth' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &
Could for some reason not set markup. Text: Futurecop! - The Unicorn & the Lost City of Alvograth
i don't think swaync should be parsing all that as html really
@ptrcnull Do the notifications display correctly? That's an internal warning then trying to parse invalid markup. I'll close the issue for now
They do, because it falls back to the escaped text; it's still invalid behaviour in my opinion, given that the spec only specifies a handful of valid markup tags and no support for HTML entities at all:
https://specifications.freedesktop.org/notification-spec/notification-spec-latest.html#markup
So you're talking about only parsing valid tags? So if I run this notify-send "Summary" "<very_invalid_tag> normal text, <small>very tiny text</small>"
, only the "small" tag would be parsed?
Yes, that (except that the <small>
tag isn't technically supported per specification and " notifications should never take advantage of tags that are not listed above"), and also escaping the &
sign before passing it to Pango - a lot of notifications can have a standalone &
character and currently it prints 2 warnings to the stderr on every such notification.
As a sidenote, it would be cool to be able to just disable markup entirely in the options and skip exporting the body-markup
capability; in the ideal situation, the protocol would have a field to determine whether the message should be parsed as markup, but sadly it doesn't...
@ptrcnull does the PR fix your issue?
can confirm it fixes both the \<something> and the & cases
To reproduce:
This is usually an issue with IRC messages which use that format as the message body.