mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: Fix trying to import an html file/css file via the add new file button always resulting in a blank file
This commit is contained in:
parent
d821b2ddb7
commit
f17f6886a6
@ -667,6 +667,7 @@ class NewFileDialog(QDialog): # {{{
|
||||
name, ext = name.rpartition('.')[0::2]
|
||||
name = (name + '.' + ext.lower()).replace('\\', '/')
|
||||
mt = guess_type(name)
|
||||
if not self.file_data:
|
||||
if mt in OEB_DOCS:
|
||||
self.file_data = template_for('html').encode('utf-8')
|
||||
self.using_template = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user