mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Footnotes: improve superscript detection
This commit is contained in:
+5
-1
@@ -2,8 +2,12 @@ const getTypes = el => new Set(el?.getAttributeNS?.('http://www.idpf.org/2007/op
|
||||
const getRoles = el => new Set(el?.getAttribute?.('role')?.split(' '))
|
||||
|
||||
const isSuper = el => {
|
||||
if (el.matches('sup')) return true
|
||||
const { verticalAlign } = getComputedStyle(el)
|
||||
return verticalAlign === 'super' || /^\d/.test(verticalAlign)
|
||||
return verticalAlign === 'super'
|
||||
|| verticalAlign === 'top'
|
||||
|| verticalAlign === 'text-top'
|
||||
|| /^\d/.test(verticalAlign)
|
||||
}
|
||||
|
||||
const refTypes = ['biblioref', 'glossref', 'noteref']
|
||||
|
||||
Reference in New Issue
Block a user