|
|
|
@ -36,6 +36,12 @@ def filenameforpage(p):
|
|
|
|
|
f = p.name.replace(' ','_').replace('/', SLASH) + '.html'
|
|
|
|
|
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):
|
|
|
|
|
t = html5lib.parseFragment(html, treebuilder = "etree", namespaceHTMLElements = False)
|
|
|
|
|
for a in t.findall(".//*[@href]"):
|
|
|
|
|