adding a regex to remove the [] from footnotes

This commit is contained in:
manetta 2021-09-08 15:34:52 +02:00
parent d331964a64
commit 1a0c35dc03
2 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,8 @@ def clean_up(html):
"""
html = re.sub(r'\[.*edit.*\]', '', html) # remove the [edit]
html = re.sub(r'href="/book/index.php\?title=', 'href="#', html) # remove the internal wiki links
html = re.sub(r'[(?=\d)', '', html) # remove left footnote bracket [
html = re.sub(r'(?<=\d)&#93;', '', html) # remove right footnote bracket ]
return html
def parse_page(pagename, wiki):

View File

@ -87,6 +87,8 @@ def clean_up(html):
"""
html = re.sub(r'\[.*edit.*\]', '', html) # remove the [edit]
html = re.sub(r'href="/book/index.php\?title=', 'href="#', html) # remove the internal wiki links
html = re.sub(r'&#91;(?=\d)', '', html) # remove left footnote bracket [
html = re.sub(r'(?<=\d)&#93;', '', html) # remove right footnote bracket ]
return html
def parse_page(pagename, wiki):