mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix a link that has some text along with a superscript/subscript being incorrectly detected as a footnote link
This commit is contained in:
parent
b20610910e
commit
6305d5c647
Binary file not shown.
@ -75,7 +75,9 @@ is_footnote_link = (node, url, linked_to_anchors) ->
|
|||||||
if children.length == 1
|
if children.length == 1
|
||||||
style = window.getComputedStyle(children[0])
|
style = window.getComputedStyle(children[0])
|
||||||
if style.display in ['inline', 'inline-block'] and style.verticalAlign in ['sub', 'super', 'top', 'bottom']
|
if style.display in ['inline', 'inline-block'] and style.verticalAlign in ['sub', 'super', 'top', 'bottom']
|
||||||
return true
|
text_children = (x for x in node.childNodes when x.nodeType == Node.TEXT_NODE and x.nodeValue and /\S+/.test(x.nodeValue))
|
||||||
|
if not text_children.length
|
||||||
|
return true
|
||||||
|
|
||||||
eid = node.getAttribute('id') or node.getAttribute('name')
|
eid = node.getAttribute('id') or node.getAttribute('name')
|
||||||
if eid and linked_to_anchors.hasOwnProperty(eid)
|
if eid and linked_to_anchors.hasOwnProperty(eid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user