mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Fix non-ASCII content in stylesheets not being interpreted correctly. Fixes #1848858 [Issue with viewer: '::before'](https://bugs.launchpad.net/calibre/+bug/1848858)
This commit is contained in:
parent
f10f23d4f6
commit
c0fa79d58b
@ -502,6 +502,11 @@ class Container(ContainerBase):
|
||||
|
||||
def serialize_item(self, name):
|
||||
mt = (self.mime_map[name] or '').lower()
|
||||
if mt in OEB_STYLES:
|
||||
ans = ContainerBase.serialize_item(self, name).lstrip()
|
||||
if not ans.startswith(b'@charset'):
|
||||
ans = b'@charset "UTF-8";\n' + ans
|
||||
return ans
|
||||
if mt not in OEB_DOCS:
|
||||
return ContainerBase.serialize_item(self, name)
|
||||
root = self.parsed(name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user