Markdown compat by mjschultz · Pull Request #3604 · encode/django-rest-framework (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits5 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

mjschultz

The current apply_markdown generates the following DeprecationWarnings:

markdown/__init__.py:143: DeprecationWarning: "safe_mode" is deprecated in Python-Markdown. Use an HTML sanitizer (like Bleach http://bleach.readthedocs.org/) if you are parsing untrusted markdown text. See the 2.6 release notes for more info

markdown/__init__.py:222: DeprecationWarning: Setting configs in the Named Extension string is deprecated. It is recommended that you pass an instance of the extension class to Markdown or use the "extension_configs" keyword. The current behavior will raise an error in version 2.7. See the Release Notes for Python-Markdown version 2.6 for more info.

markdown/__init__.py:259: DeprecationWarning: Using short names for Markdown's builtin extensions is deprecated. Use the full path to the extension with Python's dot notation (eg: "markdown.extensions.headerid" instead of "headerid"). The current behavior will raise an error in version 2.7. See the Release Notes for Python-Markdown version 2.6 for more info.

These three commits correct them per the Python-Markdown 2.6 release notes.

@jpadilla

@tomchristie

Great. Which versions does this now work against? Do we need to double check that against what we current list as supported?

@mjschultz

It looks like extension_configs was introduced in python-markdown 2.5 which has been out for a year. I'm not sure what version(s) of markdown you'd like to support down to though?

Is there a way to automate this or should I manually verify markdown versions from current down to something?

@mjschultz

Here is what I have right now running ./runtests.py --fast:

env py2.7 py3.4
markdown==2.6.4 x x
markdown==2.5.2 x x
markdown==2.4.1 x x
markdown==2.3.1 x x
markdown==2.2.1 x x
markdown==2.1.1 x x
markdown==2.0.3

@tomchristie

Okay. Currently the homepage lists 2.1.0+ as our requirement.
We could either:

@mjschultz

@mjschultz

@mjschultz

Okay, it turns out in markdown 2.2 they changed the extensions framework a bit to permit external modules with more ease. This means that 2.1 would force a markdown.extensions in front of the headerid causing the errors.

I added some changes that check markdown.version and set the headerid extension path based on that. I updated the checklist above.

I also bumped the markdown version in requirements-optionals.txt.

@xordoquy

Closed in favor of #3842.
Thanks @mjschultz and sorry this didn't got merged faster.

xordoquy added a commit that referenced this pull request

Jan 19, 2016

@xordoquy

Markdown compat (overtakes #3604)

This was referenced

Mar 9, 2017