[gnome-packagekit/wip/mak/betterchangelog: 1/2] Don't fail if changelog contains XML characters




commit 8dda9c2085c2c1eac3754cfc282eb0f81d0211b2
Author: Matthias Klumpp <matthias tenstral net>
Date:   Wed Jul 27 02:26:00 2022 +0200

    Don't fail if changelog contains XML characters
    
    We just render the changelog verbatim as monospaced text now, instead of
    failing and displaying no update information at all.

 src/gpk-update-viewer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index eb04ab13..ef31c247 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -1799,8 +1799,12 @@ gpk_update_viewer_populate_details (PkUpdateDetail *item)
        /* only show changelog if we didn't have any update text */
        if (!has_update_text && !_g_strzero (changelog)) {
                if (!_g_strzero (changelog)) {
+                       g_autofree gchar *changelog_escaped = g_markup_escape_text (changelog, -1);
+
                        /* TRANSLATORS: this is a ChangeLog */
-                       line2 = g_strdup_printf ("%s\n%s\n", _("The developer logs will be shown as no 
description is available for this update:"), changelog);
+                       line2 = g_strdup_printf ("%s\n\n<tt>%s</tt>",
+                                                _("The developer logs will be shown as no description is 
available for this update:"),
+                                                changelog_escaped);
                        gtk_text_buffer_insert_markup (text_buffer, &iter, line2, -1);
                        g_free (line2);
                }


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