mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
01511731e3
commit
6a2490005c
@ -29,8 +29,10 @@ def syntax_from_mime(name, mime):
|
||||
if mime.endswith('+xml'):
|
||||
return 'xml'
|
||||
|
||||
all_text_syntaxes = frozenset({'text', 'html', 'xml', 'css', 'javascript'})
|
||||
|
||||
def editor_from_syntax(syntax, parent=None):
|
||||
if syntax in {'text', 'html', 'css', 'xml', 'javascript'}:
|
||||
if syntax in all_text_syntaxes:
|
||||
from calibre.gui2.tweak_book.editor.widget import Editor
|
||||
return Editor(syntax, parent=parent)
|
||||
elif syntax == 'raster_image':
|
||||
|
Loading…
x
Reference in New Issue
Block a user