getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.57k stars 1.81k forks source link

Markdown footnotes generate incorrect HTML #1303

Closed Mihara closed 10 years ago

Mihara commented 10 years ago

Markdown footnote extension as it is being used generates incorrect footnote IDs, to be more specific.

Footnotes generated by Markdown extension with out-of-the-box Pelican look like this: '#fn:1' (where '1' is the footnote name in the [^1] syntax). Unfortunately this is illegal in html5, and I believe in some other places as well - the resulting links don't work with any html5 template.

Markdown itself provides the solution: the 'output_format' parameter, which can be set to html, html4, html5, xhtml, xhtml1 and xhtml5. I am not clear entirely on what else this does to Markdown's output, but if the output_format is set to 'html5' or 'xhtml5', the footnote IDs become '#fn-1' and everything works fine.

While it would be tempting to suggest to make it generate html5 at all times (It'd be a one line change ) I am not entirely sure if this is a correct solution -- it works for me, but there's no guarantee every template is html5. Can anyone remember any templates that aren't?

justinmayer commented 10 years ago

Hi Eugene. Given that this is essentially a dupe of #1024, I'm going to close this issue in favor of that one. That said, it would be great if, after reviewing the conversation in that issue, you could implement an appropriate solution. Thanks!