From 1a0c35dc03d8d98bcd53e9bd198c993e9bd10200 Mon Sep 17 00:00:00 2001 From: manetta Date: Wed, 8 Sep 2021 15:34:52 +0200 Subject: [PATCH] adding a regex to remove the [] from footnotes --- command-line/update.py | 2 ++ web-interface/update.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/command-line/update.py b/command-line/update.py index 724d973..f7c3737 100644 --- a/command-line/update.py +++ b/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)]', '', html) # remove right footnote bracket ] return html def parse_page(pagename, wiki): diff --git a/web-interface/update.py b/web-interface/update.py index d28c7f2..7ada867 100644 --- a/web-interface/update.py +++ b/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'[(?=\d)', '', html) # remove left footnote bracket [ + html = re.sub(r'(?<=\d)]', '', html) # remove right footnote bracket ] return html def parse_page(pagename, wiki):