|
|
@ -36,6 +36,12 @@ def filenameforpage(p):
|
|
|
|
f = p.name.replace(' ','_').replace('/', SLASH) + '.html'
|
|
|
|
f = p.name.replace(' ','_').replace('/', SLASH) + '.html'
|
|
|
|
return f
|
|
|
|
return f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def filenameforlink(href):
|
|
|
|
|
|
|
|
if href.startswith("/sandbox/itchwiki/index.php/"):
|
|
|
|
|
|
|
|
href = href[len("/sandbox/itchwiki/index.php/"):]
|
|
|
|
|
|
|
|
return href.replace(' ','_').replace('/', SLASH) + '.html'
|
|
|
|
|
|
|
|
return href
|
|
|
|
|
|
|
|
|
|
|
|
def rewritelinks (html):
|
|
|
|
def rewritelinks (html):
|
|
|
|
t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False)
|
|
|
|
t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False)
|
|
|
|
for a in t.findall(".//*[@href]"):
|
|
|
|
for a in t.findall(".//*[@href]"):
|
|
|
|