From 686d2857313a3b641bcc8f02528452bf256f1b78 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 7 Apr 2024 23:17:58 +0100 Subject: [PATCH] Fix hypertext escaping of game links --- app/utils/minetest_hypertext.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/utils/minetest_hypertext.py b/app/utils/minetest_hypertext.py index cacfe53b..e035bcee 100644 --- a/app/utils/minetest_hypertext.py +++ b/app/utils/minetest_hypertext.py @@ -241,7 +241,7 @@ def package_info_as_hypertext(package: Package, formspec_version: int = 7): def add_value(label, value): nonlocal body - body += f"{label}: {escape_hypertext(str(value))}\n\n" + body += f"{label}: {str(value)}\n\n" def add_list(label, items): nonlocal body @@ -250,10 +250,10 @@ def package_info_as_hypertext(package: Package, formspec_version: int = 7): for i, item in enumerate(items): if i != 0: body += ", " - body += f"{escape_hypertext(str(item))}" + body += f"{str(item)}" if len(items) == 0: - body += "" + escape_hypertext(gettext("none")) + "" + body += "" + gettext("none") + "" body += "\n\n" @@ -264,7 +264,7 @@ def package_info_as_hypertext(package: Package, formspec_version: int = 7): def make_game_link(game): key = f"link_{len(links)}" links[key] = game.get_url("packages.view", absolute=True) - return f"{game.title}" + return f"{escape_hypertext(game.title)}" [supported, unsupported] = package.get_sorted_game_support_pair() supports_all_games = package.supports_all_games or len(supported) == 0