Avoid JS errors when previewing non html documents such as svg images

This commit is contained in:
Kovid Goyal 2021-11-19 08:15:44 +05:30
parent 37c35a1ec4
commit 2fa3561aef
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -207,12 +207,13 @@ def load_mathjax():
document.head.appendChild(script) document.head.appendChild(script)
document.body.addEventListener('click', onclick, True) if document.body:
document.documentElement.appendChild(E.style( document.body.addEventListener('click', onclick, True)
type='text/css', document.documentElement.appendChild(E.style(
'[data-in-split-mode="1"] [data-is-block="1"]:hover { cursor: pointer !important; border-top: solid 5px green !important }' type='text/css',
)) '[data-in-split-mode="1"] [data-is-block="1"]:hover { cursor: pointer !important; border-top: solid 5px green !important }'
))
fix_fullscreen_svg_images() fix_fullscreen_svg_images()
if check_for_maths(): if check_for_maths():
load_mathjax() load_mathjax()