[recipes] Fix markup handling in instructions



commit e3ef993d19c837e79617a6c89f4e7b68374bc0d1
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 6 22:14:28 2017 -0500

    Fix markup handling in instructions
    
    Commit 9fadd101a0ed3099005fdbb022e7b7efea31d826 had a thinko -
    of course, we still use markup in the instruction label, for
    the image and timer display. So, instead of turning off markup,
    we need to escape the markup in the text.

 src/gr-details-page.c  |    4 +++-
 src/gr-details-page.ui |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-details-page.c b/src/gr-details-page.c
index 3ebefd5..a836012 100644
--- a/src/gr-details-page.c
+++ b/src/gr-details-page.c
@@ -562,6 +562,7 @@ process_instructions (const char *instructions)
 
         for (i = 0; i < steps->len; i++) {
                 GrRecipeStep *step = (GrRecipeStep *)g_ptr_array_index (steps, i);
+                g_autofree char *escaped = NULL;
 
                 if (i > 0)
                         g_string_append (s, "\n\n");
@@ -591,7 +592,8 @@ process_instructions (const char *instructions)
                         g_string_append (s, "\">♦</a>");
                 }
 
-                g_string_append (s, step->text);
+                escaped = g_markup_escape_text (step->text, -1);
+                g_string_append (s, escaped);
         }
 
         return g_string_free (s, FALSE);
diff --git a/src/gr-details-page.ui b/src/gr-details-page.ui
index 1a3ebdd..14dc2d3 100644
--- a/src/gr-details-page.ui
+++ b/src/gr-details-page.ui
@@ -423,6 +423,7 @@
                         <child>
                           <object class="GtkLabel" id="instructions_label">
                             <property name="visible">1</property>
+                            <property name="use-markup">1</property>
                             <property name="xalign">0</property>
                             <property name="track-visited-links">0</property>
                             <property name="wrap">1</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]