After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 786197 - GdMainIconBoxChild: Don't set use-markup on the GtkLabels
GdMainIconBoxChild: Don't set use-markup on the GtkLabels
Status: RESOLVED FIXED
Product: libgd
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: libgd maintainer(s)
libgd maintainer(s)
Depends on:
Blocks: 780692
 
 
Reported: 2017-08-12 12:42 UTC by Debarshi Ray
Modified: 2017-08-18 10:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main-icon-box-child: Don't set use-markup on the GtkLabels (1.50 KB, patch)
2017-08-12 22:59 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-08-12 12:42:37 UTC
The primary and secondary GtkLabels in GdMainIconBoxChild have use-markup=TRUE. That's a problem if GdMainBoxItem:primary/secondary-text has things like ampersands and angular brackets in them.

One option is to escape the strings using a GBindingTransformFunc so that they are parsed verbatim. However, there is no way of knowing if the strings actually have markup or not. eg., "Foo < Bar" versus "<b>Foo Bar</b>". g_markup_escape_text will corrupt the markup in the latter case.

Therefore, I think we shouldn't unconditionally set GtkLabel:user-markup.

In future, if some application does want to use markup, we should add a new GdMainBoxItem property to conditionally set it, and let the GdMainBoxItem take care of properly escaping the string.
Comment 1 Debarshi Ray 2017-08-12 22:59:30 UTC
Created attachment 357495 [details] [review]
main-icon-box-child: Don't set use-markup on the GtkLabels
Comment 2 Debarshi Ray 2017-08-18 10:33:33 UTC
Comment on attachment 357495 [details] [review]
main-icon-box-child: Don't set use-markup on the GtkLabels

I am tentatively pushing this because we are reaching the end of the development cycle. Let me know if something is wrong.