Add warning if footnote link and text counts mismatch.

This commit is contained in:
Ethan Dalool 2020-04-02 20:20:46 -07:00
parent 4147020aa4
commit 137c48463e

View file

@ -573,8 +573,12 @@ def markdown(
css = cat_files(css) css = cat_files(css)
body = VMARKDOWN(md) 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) html = html_replacements(html)
soup = bs4.BeautifulSoup(html, 'html.parser') soup = bs4.BeautifulSoup(html, 'html.parser')