feat: parse html markup to rich_text#144
Conversation
jacobgkau
left a comment
There was a problem hiding this comment.
Testing this with the examples at: https://web-push-book.gauntface.com/demos/notification-examples/
Links & icons before:
Links & icons after:
Both "Title & Body" tests triggered a crash that caused the panel to disappear and restart before. After, those two work:
The only problem I'm seeing is that the hyperlink color is too dark in dark mode. It probably needs to be sourced from the COSMIC theme somehow instead of being hard-coded to that blue color. Can you either set the color more intelligently, or leave it the default text color for now (especially as the links aren't clickable, yet, anyway)?
CC @pop-os/ux-- not sure what the correct color to use for hyperlink text would be. Notifications use the window background color for the background. Would accent color suffice? It looks like we currently use accent color for the links in the View -> About menus in some of our COSMIC apps (although the links in those cases use a tinted version of the container background, rather than the window background, for their background color). We also have an "Interface text hint" setting, but I'm not sure what actually uses that right now.
|
Link text color would be |
Interface text tint is used as the base color to derive the text color if it was customized by the user. It's black/white by default depending on the mode. |
Hmm, wonder what was the issue here. |
|
Hi, Turns out this fixes notifications as they appear, but the issue remains when opening notification history. Thanks |

Hey!
This PR adds additional dependency,
tlfor HTML parsing. It's also provide new modulemarkupwith simple parser of HTML tags allowed by https://specifications.freedesktop.org/notification/1.2/markup.htmlFrom my simple testing,
cosmic-notificationsdisplay correctrich_textand also works with nested tags.This will display like those:



However I did not test this properly with third party applications like Vivaldi, or Slack which displays HTML in notifications. I just used some website which sends defined
bodyvia Zen Browser.Links are not clickable, just styled text. Also images are skipped for now.
#edit
btw. Notification applet require new changes, I can implement this if this PR seems OK to you.