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 }})
The current apply_markdown
generates the following DeprecationWarning
s:
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.
Great. Which versions does this now work against? Do we need to double check that against what we current list as supported?
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?
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 |
Okay. Currently the homepage lists 2.1.0+ as our requirement.
We could either:
- Bump to 2.2 (Not ideal since it'd be in a minor release)
- Ensure that the compat handles both styles dep on what's available.
- Something else?
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
.
Closed in favor of #3842.
Thanks @mjschultz and sorry this didn't got merged faster.
xordoquy added a commit that referenced this pull request
Markdown compat (overtakes #3604)
This was referenced
Mar 9, 2017