From b9a9b49b8015e3c4085eaabee88763fb82b376ff Mon Sep 17 00:00:00 2001 From: guinux Date: Sat, 16 Apr 2016 09:43:14 +0200 Subject: [PATCH] fix escaped text --- src/daemon.vala | 12 ++++++------ src/manager_window.vala | 16 +++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/daemon.vala b/src/daemon.vala index 7fcaa8d..977ba78 100644 --- a/src/daemon.vala +++ b/src/daemon.vala @@ -430,7 +430,7 @@ namespace Pamac { name = alpm_pkg.name, version = alpm_pkg.version, // desc can be null - desc = alpm_pkg.desc != null ? Markup.escape_text (alpm_pkg.desc) : "", + desc = alpm_pkg.desc ?? "", repo = (owned) repo_name, size = alpm_pkg.isize, origin = (uint) alpm_pkg.origin @@ -573,7 +573,7 @@ namespace Pamac { name = json_object.get_string_member ("Name"), version = json_object.get_string_member ("Version"), // desc can be null - desc = json_object.get_null_member ("Description") ? "" : Markup.escape_text (json_object.get_string_member ("Description")), + desc = json_object.get_null_member ("Description") ? "" : json_object.get_string_member ("Description"), popularity = json_object.get_double_member ("Popularity") }; } @@ -630,7 +630,7 @@ namespace Pamac { version = json_object.get_string_member ("Version"); // desc can be null if (!json_object.get_null_member ("Description")) { - desc = Markup.escape_text (json_object.get_string_member ("Description")); + desc = json_object.get_string_member ("Description"); } popularity = json_object.get_double_member ("Popularity"); // packagebase @@ -638,7 +638,7 @@ namespace Pamac { // url can be null unowned Json.Node? node = json_object.get_member ("URL"); if (!node.is_null ()) { - url = Markup.escape_text (node.get_string ()); + url = node.get_string (); } // maintainer can be null node = json_object.get_member ("Maintainer"); @@ -974,11 +974,11 @@ namespace Pamac { version = alpm_pkg.version; // desc can be null if (alpm_pkg.desc != null) { - desc = Markup.escape_text (alpm_pkg.desc); + desc = alpm_pkg.desc; } // url can be null if (alpm_pkg.url != null) { - url = Markup.escape_text (alpm_pkg.url); + url = alpm_pkg.url; } // packager can be null packager = alpm_pkg.packager ?? ""; diff --git a/src/manager_window.vala b/src/manager_window.vala index 00cac22..ab6e6fc 100644 --- a/src/manager_window.vala +++ b/src/manager_window.vala @@ -388,8 +388,9 @@ namespace Pamac { AlpmPackageDetails details = transaction.get_pkg_details (pkgname); // infos name_label.set_markup ("%s %s".printf (details.name, details.version)); - desc_label.set_markup (details.desc); - link_label.set_markup ("%s".printf (details.url, details.url)); + desc_label.set_text (details.desc); + string escaped_url = Markup.escape_text (details.url); + link_label.set_markup ("%s".printf (escaped_url, escaped_url)); StringBuilder licenses = new StringBuilder (); licenses.append (dgettext (null, "Licenses")); licenses.append (":"); @@ -397,7 +398,7 @@ namespace Pamac { licenses.append (" "); licenses.append (license); } - licenses_label.set_markup (licenses.str); + licenses_label.set_text (licenses.str); // details details_list.clear (); details_list.insert_with_values (null, -1, @@ -554,7 +555,8 @@ namespace Pamac { name_label.set_markup ("%s %s".printf (details.name, details.version)); desc_label.set_text (details.desc); string aur_url = "http://aur.archlinux.org/packages/" + details.name; - link_label.set_markup ("%s\n\n%s".printf (details.url, details.url, aur_url, aur_url)); + string escaped_url = Markup.escape_text (details.url); + link_label.set_markup ("%s\n\n%s".printf (escaped_url, escaped_url, aur_url, aur_url)); StringBuilder licenses = new StringBuilder (); licenses.append (dgettext (null, "Licenses")); licenses.append (":"); @@ -664,7 +666,7 @@ namespace Pamac { packages_list.insert_with_values (null, -1, 0, pkg.origin, 1, pkg.name, - 2, "%s\n%s".printf (pkg.name, pkg.desc), + 2, "%s\n%s".printf (pkg.name, Markup.escape_text (pkg.desc)), 3, pkg.version, 4, pkg.repo, 5, pkg.size, @@ -686,7 +688,7 @@ namespace Pamac { aur_list.insert_with_values (null, -1, 0, alpm_pkg.origin, 1, alpm_pkg.name, - 2, "%s\n%s".printf (alpm_pkg.name, alpm_pkg.desc), + 2, "%s\n%s".printf (alpm_pkg.name, Markup.escape_text (alpm_pkg.desc)), 3, alpm_pkg.version, 4, aur_pkg.popularity, 5, "%.2f".printf (aur_pkg.popularity)); @@ -694,7 +696,7 @@ namespace Pamac { aur_list.insert_with_values (null, -1, 0, 0, 1, aur_pkg.name, - 2, "%s\n%s".printf (aur_pkg.name, aur_pkg.desc), + 2, "%s\n%s".printf (aur_pkg.name, Markup.escape_text (aur_pkg.desc)), 3, aur_pkg.version, 4, aur_pkg.popularity, 5, "%.2f".printf (aur_pkg.popularity));