From 7568eda031c4820daf87ad2479ac7ad57da1b218 Mon Sep 17 00:00:00 2001 From: Arthur Milchior Date: Sun, 15 Aug 2021 06:32:03 +0200 Subject: [PATCH] Add Card history: keep & instead of replacing them by underline --- qt/aqt/addcards.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index ae76e8259..a99587c67 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -191,6 +191,9 @@ class AddCards(QDialog): txt = f"{txt[:30]}..." line = tr.adding_edit(val=txt) line = gui_hooks.addcards_will_add_history_entry(line, note) + line = line.replace("&", "&&") + # In qt action "&i" means "underline i, trigger this line when i is pressed". + # except for "&&" which is replaced by a single "&" a = m.addAction(line) qconnect(a.triggered, lambda b, nid=nid: self.editHistory(nid)) else: