Add support for syntax highlighting box-sizing

This commit is contained in:
Kovid Goyal 2020-10-19 09:17:12 +05:30
parent 51e94dcc65
commit 653af227c1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 3 deletions

View File

@ -40,8 +40,8 @@ content_tokens = [(re.compile(k), v, n) for k, v, n in [
r'border-right-style|border-right-width|border-right|border-top-color|'
r'border-top-style|border-top-width|border-bottom|'
r'border-collapse|border-left|border-width|border-color|'
r'border-spacing|border-style|border-top|border|caption-side|'
r'clear|clip|color|content|counter-increment|counter-reset|'
r'border-spacing|border-style|border-top|border-box|border|box-sizing|caption-side|'
r'clear|clip|color|content-box|content|counter-increment|counter-reset|'
r'cue-after|cue-before|cue|cursor|direction|display|'
r'elevation|empty-cells|float|font-family|font-size|'
r'font-size-adjust|font-stretch|font-style|font-variant|'
@ -329,6 +329,7 @@ if __name__ == '__main__':
/* A demonstration css sheet */
body {
color: green;
box-sizing: border-box;
font-size: 12pt
}

View File

@ -604,6 +604,7 @@ class Editor(QMainWindow):
def launch_editor(path_to_edit, path_is_raw=False, syntax='html', callback=None):
from calibre.gui2 import Application
from calibre.gui2.tweak_book import dictionaries
from calibre.gui2.tweak_book.main import option_parser
from calibre.gui2.tweak_book.ui import Main
@ -611,7 +612,7 @@ def launch_editor(path_to_edit, path_is_raw=False, syntax='html', callback=None)
dictionaries.initialize()
refresh_spell_check_status()
opts = option_parser().parse_args([])
app = QApplication([])
app = Application([])
# Create the actions that are placed into the editors toolbars
main = Main(opts) # noqa
if path_is_raw: