Browse Source

adding a regex to remove the [] from footnotes

master
manetta 3 years ago
parent
commit
1a0c35dc03
  1. 2
      command-line/update.py
  2. 2
      web-interface/update.py

2
command-line/update.py

@ -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):

2
web-interface/update.py

@ -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):

Loading…
Cancel
Save