mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
...
This commit is contained in:
parent
872827f817
commit
288c3a285f
@ -31,6 +31,7 @@ from calibre.utils.titlecase import titlecase
|
||||
PARAGRAPH_SEPARATOR = '\u2029'
|
||||
|
||||
def get_highlighter(syntax):
|
||||
if syntax:
|
||||
try:
|
||||
return importlib.import_module('calibre.gui2.tweak_book.editor.syntax.' + syntax).Highlighter
|
||||
except (ImportError, AttributeError):
|
||||
@ -38,6 +39,7 @@ def get_highlighter(syntax):
|
||||
return SyntaxHighlighter
|
||||
|
||||
def get_smarts(syntax):
|
||||
if syntax:
|
||||
smartsname = {'xml':'html'}.get(syntax, syntax)
|
||||
try:
|
||||
return importlib.import_module('calibre.gui2.tweak_book.editor.smarts.' + smartsname).Smarts
|
||||
|
Loading…
x
Reference in New Issue
Block a user