mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
MOBI Output: When inserting metadata, hide the searchable version of the tags (append with ttt). They are still searchable, but not visible. Also Fix #5424 (Keyboard Shortcut 'o' doesnt work if the path name contains '#')
This commit is contained in:
parent
73ba818428
commit
b91f16d0c4
@ -4,6 +4,7 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
from itertools import izip
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
from calibre.customize import Plugin as _Plugin
|
||||
|
||||
@ -238,7 +239,7 @@ class OutputProfile(Plugin):
|
||||
|
||||
@classmethod
|
||||
def tags_to_string(cls, tags):
|
||||
return ', '.join(tags)
|
||||
return escape(', '.join(tags))
|
||||
|
||||
class iPadOutput(OutputProfile):
|
||||
|
||||
@ -383,7 +384,8 @@ class KindleOutput(OutputProfile):
|
||||
|
||||
@classmethod
|
||||
def tags_to_string(cls, tags):
|
||||
return 'ttt '.join(tags)+'ttt '
|
||||
return u'%s <br/><span style="color: white">%s</span>' % (', '.join(tags),
|
||||
'ttt '.join(tags)+'ttt ')
|
||||
|
||||
class KindleDXOutput(OutputProfile):
|
||||
|
||||
@ -399,7 +401,8 @@ class KindleDXOutput(OutputProfile):
|
||||
|
||||
@classmethod
|
||||
def tags_to_string(cls, tags):
|
||||
return 'ttt '.join(tags)+'ttt '
|
||||
return u'%s <br/><span style="color: white">%s</span>' % (', '.join(tags),
|
||||
'ttt '.join(tags)+'ttt ')
|
||||
|
||||
class IlliadOutput(OutputProfile):
|
||||
|
||||
|
@ -99,7 +99,7 @@ class Jacket(object):
|
||||
except:
|
||||
tags = []
|
||||
if tags:
|
||||
tags = '<b>Tags: </b>' + escape(self.opts.dest.tags_to_string(tags))
|
||||
tags = '<b>Tags: </b>' + self.opts.dest.tags_to_string(tags)
|
||||
else:
|
||||
tags = ''
|
||||
try:
|
||||
|
@ -2096,7 +2096,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
|
||||
return
|
||||
for row in rows:
|
||||
path = self.library_view.model().db.abspath(row.row())
|
||||
QDesktopServices.openUrl(QUrl('file:'+path))
|
||||
QDesktopServices.openUrl(QUrl.fromLocalFile(path))
|
||||
|
||||
|
||||
def view_book(self, triggered):
|
||||
|
Loading…
x
Reference in New Issue
Block a user