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:
Kovid Goyal 2021-02-16 08:38:29 +05:30
parent 52d048ece3
commit fd77db2da5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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: