From 770c57064cdcafbaa315c1c30de4fcf1199f6d51 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 10 Jul 2014 08:41:47 +0530 Subject: [PATCH] Check more link attributes --- src/calibre/gui2/tweak_book/editor/syntax/html.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/syntax/html.py b/src/calibre/gui2/tweak_book/editor/syntax/html.py index 7204cad24d..3d03be3cf2 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/html.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/html.py @@ -52,6 +52,8 @@ TagStart = namedtuple('TagStart', 'offset prefix name closing is_start') TagEnd = namedtuple('TagEnd', 'offset self_closing is_start') Attr = namedtuple('Attr', 'offset type data') +LINK_ATTRS = {'href', 'src', 'poster', 'xlink:href'} + do_spell_check = False def refresh_spell_check_status(): @@ -439,7 +441,7 @@ def quoted_val(state, text, i, formats, user_data): except ValueError: pass add_attr_data(user_data, ATTR_VALUE, ATTR_END, i + num) - is_link = state.attribute_name in {'href', 'src'} + is_link = state.attribute_name in LINK_ATTRS if is_link: return [(num - 1, formats['link']), (1, formats['string'])]