mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Edit book: Fix editing of JavaScript files not working. Fixes #1915770 [editor creates mal-formed .js files](https://bugs.launchpad.net/calibre/+bug/1915770)
This commit is contained in:
parent
52d048ece3
commit
fd77db2da5
@ -1612,7 +1612,7 @@ class Boss(QObject):
|
||||
syntax = syntax or syntax_from_mime(name, guess_type(name))
|
||||
if use_template is None:
|
||||
data = current_container().raw_data(name)
|
||||
if isbytestring(data) and syntax in {'html', 'css', 'text', 'xml'}:
|
||||
if isbytestring(data) and syntax in {'html', 'css', 'text', 'xml', 'javascript'}:
|
||||
try:
|
||||
data = data.decode('utf-8')
|
||||
except UnicodeDecodeError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user