trentm / python-markdown2

markdown2: A fast and complete implementation of Markdown in Python
Other
2.67k stars 433 forks source link

Bug in footnote handling. #250

Open ewankirk opened 7 years ago

ewankirk commented 7 years ago

If there is a single space on the line following a footnote, the footnote regex gets a bit confused.

import markdown2

text = '''
Here is some markdown with a footnote[^myfootnote] embedded within it.

[^myfootnote]: I define the footnote here on 
    multiple lines but the line below contains *one* space but looks blank

'''
markdowner = markdown2.Markdown()
markdowner.convert(text)

This produces the following html output.

<p>Here is some markdown with a footnote[^myfootnote] embedded 
within it.</p>\n\n<pre><code>multiple lines but the line below 
contains *one* space but looks blank\n</code></pre>\n'
nicholasserra commented 7 years ago

Thanks for the report!

davidlowryduda commented 7 years ago

I wonder if I added in this bug when I last touched the footnotes. I'll look into this when I get the chance.