[evince/776-missing-markup-escape-in-printing-message-when-file-name-includes-ampersand: 11/11] printing: escape html entities in pango markup



commit 0debe32c7992fbdf216fe0dc606770b52b2ae640
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]