From c55c50ca3af1fcf599c7d7041be840e11e932c67 Mon Sep 17 00:00:00 2001 From: facelessuser Date: Sat, 7 Oct 2017 08:56:58 -0600 Subject: Strip the gathered extraneous whitespace When processing footnotes, we don't actually care to process the extra whitespace at the end of a footnote, but we want it to calculate lines to preserve. --- markdown/extensions/footnotes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/extensions/footnotes.py b/markdown/extensions/footnotes.py index 580dfa0..aa11cbf 100644 --- a/markdown/extensions/footnotes.py +++ b/markdown/extensions/footnotes.py @@ -234,7 +234,7 @@ class FootnotePreprocessor(Preprocessor): fn.insert(0, m.group(2)) i += _i-1 # skip past footnote footnote = "\n".join(fn) - self.footnotes.setFootnote(m.group(1), footnote) + self.footnotes.setFootnote(m.group(1), footnote.rstrip()) # Preserve a line for each block to prevent raw HTML indexing issue. # https://github.com/Python-Markdown/markdown/issues/584 num_blocks = (len(footnote.split('\n\n')) * 2) -- cgit v1.2.1