jamesturk / django-markupfield

📑 a MarkupField for Django

Home Page:http://pypi.python.org/pypi/django-markupfield

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Markdown footnote reset issue

nzp opened this issue · comments

This is probably a documentation issue more than anything else. When configuring Markdown, the first instinct is probably to use a configured markdown.Markdown instance in MARKUP_FIELD_TYPES. However, Markdown instances need to be explicitly reset (Markdown.reset()) after rendering to avoid issues such as this Python-Markdown/markdown#401 (I tripped on this, so here I am).

markdown.markdown handles this automatically, so the proper way, probably, to go about this is to use django.utils.functional.curry (or own similar function) to wrap it (like you do when you're adding Pygments extension) and add configuration in MARKUP_FIELD_TYPES. This should probably be mentioned in documentation.

thanks for this report, had no idea! I'll look at getting a fix in next time I have a few spare cycles