[evince/gnome-3-28] printing: escape html entities in pango markup
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/gnome-3-28] printing: escape html entities in pango markup
- Date: Sat, 29 Sep 2018 23:31:11 +0000 (UTC)
commit 09baabad6663403bd62bdb1b72429f301e31e23c
Author: Nelson Benítez León <nbenitezl gmail com>
Date: Sun Sep 2 01:59:07 2018 +0100
printing: escape html entities in pango markup
This allows message area to show the printed file
name when it contains '&' character.
Fixes #776
shell/ev-message-area.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/shell/ev-message-area.c b/shell/ev-message-area.c
index 3d5c2337..25f9a8ff 100644
--- a/shell/ev-message-area.c
+++ b/shell/ev-message-area.c
@@ -323,11 +323,13 @@ ev_message_area_set_text (EvMessageArea *area,
g_return_if_fail (EV_IS_MESSAGE_AREA (area));
if (str) {
- gchar *msg;
+ gchar *msg, *escaped;
- msg = g_strdup_printf ("<b>%s</b>", str);
+ escaped = g_markup_escape_text (str, -1);
+ msg = g_strdup_printf ("<b>%s</b>", escaped);
gtk_label_set_markup (GTK_LABEL (area->priv->label), msg);
g_free (msg);
+ g_free (escaped);
} else {
gtk_label_set_markup (GTK_LABEL (area->priv->label), NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]