Markdown footnote reset issue #40

Closed
opened 2016-08-16 13:54:00 +02:00 by nzp · 1 comment
nzp commented 2016-08-16 13:54:00 +02:00 (Migrated from github.com)

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 waylan/Python-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.

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 waylan/Python-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.
jamesturk commented 2016-08-23 17:22:36 +02:00 (Migrated from github.com)

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

thanks for this report, had no idea! I'll look at getting a fix in next time I have a few spare cycles
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jpt/django-markupfield#40
No description provided.