mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
EPUB Output: Close self closing <span> tags explicitly as they cause problems in browser based renderers like the calibre ebook viewer. Fix #3152 (MOBI Error)
This commit is contained in:
parent
207a9728c0
commit
a8f065d38f
@ -88,7 +88,8 @@ def sanitize_file_name(name, substitute='_', as_unicode=False):
|
||||
one = re.sub(r'^\.+$', '_', one)
|
||||
if as_unicode:
|
||||
one = one.decode(filesystem_encoding)
|
||||
return one.replace('..', '_')
|
||||
one = one.replace('..', substitute)
|
||||
return one
|
||||
|
||||
|
||||
def prints(*args, **kwargs):
|
||||
|
@ -1016,7 +1016,7 @@ class Manifest(object):
|
||||
if isinstance(data, etree._Element):
|
||||
ans = xml2str(data, pretty_print=self.oeb.pretty_print)
|
||||
if self.media_type in OEB_DOCS:
|
||||
ans = re.sub(r'<(div|a)([^>]*)/>', r'<\1\2></\1>', ans)
|
||||
ans = re.sub(r'<(div|a|span)([^>]*)/>', r'<\1\2></\1>', ans)
|
||||
return ans
|
||||
if isinstance(data, unicode):
|
||||
return data.encode('utf-8')
|
||||
|
@ -103,6 +103,15 @@ First install the Stanza reader on your iPhone from http://www.lexcycle.com . Th
|
||||
|
||||
Now you should be able to access your books on your iPhone.
|
||||
|
||||
Why is my device not detected in linux?
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|app| uses something called SYSFS to detect devices in linux. The linux kernel can export two version of SYSFS, one of which is deprecated. Some linux distributions still ship with kernels that support the deprecated version of SYSFS, even though it was deprecated a long time ago. In this case, device detection in |app| will not work. You can check what version of SYSFS is exported by your kernel with the following command::
|
||||
|
||||
grep SYSFS_DEPRECATED /boot/config-`uname -r`
|
||||
|
||||
You should see something like ``CONFIG_SYSFS_DEPRECATED_V2 is not set``.
|
||||
|
||||
Library Management
|
||||
------------------
|
||||
|
||||
|
@ -22,9 +22,14 @@ def ascii_text(orig):
|
||||
return ascii
|
||||
|
||||
|
||||
def ascii_filename(orig):
|
||||
return sanitize_file_name(ascii_text(orig).replace('?', '_'))
|
||||
|
||||
def ascii_filename(orig, substitute='_'):
|
||||
ans = []
|
||||
orig = ascii_text(orig).replace('?', '_')
|
||||
for x in orig:
|
||||
if ord(x) < 32:
|
||||
x = substitute
|
||||
ans.append(x)
|
||||
return sanitize_file_name(''.join(ans), substitute=substitute)
|
||||
|
||||
def supports_long_names(path):
|
||||
t = ('a'*300)+'.txt'
|
||||
|
Loading…
x
Reference in New Issue
Block a user