Add warning if footnote link and text counts mismatch.

master
Ethan Dalool 2020-04-02 20:20:46 -07:00
parent 4147020aa4
commit 137c48463e
1 changed files with 5 additions and 1 deletions

View File

@ -573,8 +573,12 @@ def markdown(
css = cat_files(css)
body = VMARKDOWN(md)
html = HTML_TEMPLATE.format(css=css, body=body)
if footnote_link_index != footnote_text_index:
links = footnote_link_index-1
texts = footnote_text_index-1
warnings.warn(f'There are {links} footnote links, but {texts} texts.')
html = HTML_TEMPLATE.format(css=css, body=body)
html = html_replacements(html)
soup = bs4.BeautifulSoup(html, 'html.parser')