This commit is contained in:
Kovid Goyal 2023-09-07 09:24:47 +05:30
parent 298c6fe3e0
commit 245bae1a2d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -395,7 +395,7 @@ def transform_html(container, name, virtualize_resources, link_uid, link_to_map,
href = a.get(attr) href = a.get(attr)
if href: if href:
href = link_replacer(name, href) href = link_replacer(name, href)
else: elif attr in a.attrib:
a.set(attr, 'javascript:void(0)') a.set(attr, 'javascript:void(0)')
if href and href.startswith(link_uid): if href and href.startswith(link_uid):
a.set(attr, 'javascript:void(0)') a.set(attr, 'javascript:void(0)')
@ -535,7 +535,7 @@ def virtualize_html(container, name, link_uid, link_to_map, virtualized_names):
elif href: elif href:
a.set('target', '_blank') a.set('target', '_blank')
a.set('rel', 'noopener noreferrer') a.set('rel', 'noopener noreferrer')
else: elif attr in a.attrib:
a.set(attr, 'javascript:void(0)') a.set(attr, 'javascript:void(0)')
for a in link_xpath(root): for a in link_xpath(root):