diff --git a/src/calibre/gui2/tweak_book/editor/syntax/css.py b/src/calibre/gui2/tweak_book/editor/syntax/css.py index 7f9e79e678..c94fc2bacb 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/css.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/css.py @@ -272,7 +272,6 @@ def create_formats(highlighter): 'class_selector': theme['Special'], 'pseudo_selector': theme['Special'], 'tag': theme['Identifier'], - 'link': theme['Link'], } for name, msg in { 'unknown-normal': _('Invalid text'), @@ -280,6 +279,7 @@ def create_formats(highlighter): }.iteritems(): f = formats[name] = syntax_text_char_format(formats['error']) f.setToolTip(msg) + formats['link'] = syntax_text_char_format(theme['Link']) formats['link'].setToolTip(_('Hold down the Ctrl key and click to open this link')) formats['link'].setProperty(LINK_PROPERTY, True) return formats diff --git a/src/calibre/gui2/tweak_book/editor/syntax/html.py b/src/calibre/gui2/tweak_book/editor/syntax/html.py index 1102b21cee..7204cad24d 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/html.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/html.py @@ -508,7 +508,6 @@ def create_formats(highlighter, add_css=True): 'preproc': t['PreProc'], 'nbsp': t['SpecialCharacter'], 'spell': t['SpellError'], - 'link': t['Link'], } for name, msg in { '<': _('An unescaped < is not allowed. Replace it with <'), @@ -527,6 +526,7 @@ def create_formats(highlighter, add_css=True): if add_css: formats['css_sub_formats'] = create_css_formats(highlighter) formats['spell'].setProperty(SPELL_PROPERTY, True) + formats['link'] = syntax_text_char_format(t['Link']) formats['link'].setProperty(LINK_PROPERTY, True) formats['link'].setToolTip(_('Hold down the Ctrl key and click to open this link')) return formats