mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: When using heuristics to detect footnote links check for vertical-align set to top and bottom as well as sub and super
This commit is contained in:
parent
7c0a12659d
commit
fed8adbcde
Binary file not shown.
@ -63,7 +63,7 @@ is_footnote_link = (node, url, linked_to_anchors) ->
|
||||
[x, num] = [node, 3]
|
||||
while x and num > 0
|
||||
style = window.getComputedStyle(x)
|
||||
if style.verticalAlign in ['sub', 'super']
|
||||
if style.verticalAlign in ['sub', 'super', 'top', 'bottom']
|
||||
return true
|
||||
x = x.parentNode
|
||||
num -= 1
|
||||
@ -72,7 +72,7 @@ is_footnote_link = (node, url, linked_to_anchors) ->
|
||||
children = (x for x in node.childNodes when x.nodeType == Node.ELEMENT_NODE)
|
||||
if children.length == 1
|
||||
style = window.getComputedStyle(children[0])
|
||||
if style.verticalAlign in ['sub', 'super']
|
||||
if style.verticalAlign in ['sub', 'super', 'top', 'bottom']
|
||||
return true
|
||||
|
||||
eid = node.getAttribute('id') or node.getAttribute('name')
|
||||
|
Loading…
x
Reference in New Issue
Block a user