mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1820549 [Ampersand is not escaped from strings on right-click menu](https://bugs.launchpad.net/calibre/+bug/1820549)
This commit is contained in:
parent
14e4682f29
commit
f760326ed2
@ -482,12 +482,13 @@ class TagsView(QTreeView): # {{{
|
|||||||
|
|
||||||
def show_context_menu(self, point):
|
def show_context_menu(self, point):
|
||||||
def display_name(tag):
|
def display_name(tag):
|
||||||
|
ans = tag.name
|
||||||
if tag.category == 'search':
|
if tag.category == 'search':
|
||||||
n = tag.name
|
n = tag.name
|
||||||
if len(n) > 45:
|
if len(n) > 45:
|
||||||
n = n[:45] + '...'
|
n = n[:45] + '...'
|
||||||
return "'" + n + "'"
|
ans = "'" + n + "'"
|
||||||
return tag.name
|
return ans.replace('&', '&&')
|
||||||
|
|
||||||
index = self.indexAt(point)
|
index = self.indexAt(point)
|
||||||
self.context_menu = QMenu(self)
|
self.context_menu = QMenu(self)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user