|
|
@ -55,10 +55,9 @@ def rewritelinks (html):
|
|
|
|
|
|
|
|
|
|
|
|
# remove links to wiki File: pages
|
|
|
|
# remove links to wiki File: pages
|
|
|
|
for a in t.findall(".//a[@class='image']"): # select img wrapping a
|
|
|
|
for a in t.findall(".//a[@class='image']"): # select img wrapping a
|
|
|
|
href = a.attrib.get('href')
|
|
|
|
href = a.attrib.get('href')
|
|
|
|
if a.findall(".//img") and 'File:' in href: # ensure a has child: img
|
|
|
|
if a.findall(".//img") and 'File:' in href: # ensure a has child: img
|
|
|
|
a.attrib['href'] = 'javascript:void(0);' # disable href
|
|
|
|
a.attrib['href'] = 'javascript:void(0);' # disable href
|
|
|
|
print('a wrapping img:', ET.tostring(a))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for a in t.findall(".//*[@href]"):
|
|
|
|
for a in t.findall(".//*[@href]"):
|
|
|
|
linkclass = a.attrib.get("class", "")
|
|
|
|
linkclass = a.attrib.get("class", "")
|
|
|
|