mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Check more link attributes
This commit is contained in:
parent
30d4453a7b
commit
770c57064c
@ -52,6 +52,8 @@ TagStart = namedtuple('TagStart', 'offset prefix name closing is_start')
|
|||||||
TagEnd = namedtuple('TagEnd', 'offset self_closing is_start')
|
TagEnd = namedtuple('TagEnd', 'offset self_closing is_start')
|
||||||
Attr = namedtuple('Attr', 'offset type data')
|
Attr = namedtuple('Attr', 'offset type data')
|
||||||
|
|
||||||
|
LINK_ATTRS = {'href', 'src', 'poster', 'xlink:href'}
|
||||||
|
|
||||||
do_spell_check = False
|
do_spell_check = False
|
||||||
|
|
||||||
def refresh_spell_check_status():
|
def refresh_spell_check_status():
|
||||||
@ -439,7 +441,7 @@ def quoted_val(state, text, i, formats, user_data):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
add_attr_data(user_data, ATTR_VALUE, ATTR_END, i + num)
|
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:
|
if is_link:
|
||||||
return [(num - 1, formats['link']), (1, formats['string'])]
|
return [(num - 1, formats['link']), (1, formats['string'])]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user