From d060acb90a3055055a0bda38c02651ba739fb021 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Fri, 16 Jun 2023 13:16:48 +0200 Subject: [PATCH] Escape game titles in toasts --- src/game.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/game.py b/src/game.py index e7be76c..734e195 100644 --- a/src/game.py +++ b/src/game.py @@ -24,7 +24,7 @@ import subprocess from pathlib import Path from time import time -from gi.repository import Adw, GObject, Gtk +from gi.repository import Adw, GLib, GObject, Gtk from src import shared # pylint: disable=no-name-in-module @@ -154,7 +154,9 @@ class Game(Gtk.Box): if toast: self.create_toast( # The variable is the title of the game - (_("{} hidden") if self.hidden else _("{} unhidden")).format(self.name), + (_("{} hidden") if self.hidden else _("{} unhidden")).format( + GLib.markup_escape_text(self.name) + ), "hide", ) @@ -168,7 +170,9 @@ class Game(Gtk.Box): self.win.on_go_back_action() # The variable is the title of the game - self.create_toast(_("{} removed").format(self.name), "remove") + self.create_toast( + _("{} removed").format(GLib.markup_escape_text(self.name)), "remove" + ) def set_loading(self, state): self.loading += state