Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown compat #3604

Closed
wants to merge 5 commits into from
Closed

Markdown compat #3604

wants to merge 5 commits into from

Conversation

mjschultz
Copy link
Contributor

@mjschultz mjschultz commented Nov 5, 2015

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
Copy link
Member

jpadilla commented Nov 6, 2015

@mjschultz looks good to me, thanks!

@tomchristie
Copy link
Member

tomchristie commented Nov 9, 2015

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

@mjschultz
Copy link
Contributor Author

mjschultz commented Nov 9, 2015

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
Copy link
Contributor Author

mjschultz commented Nov 9, 2015

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
Copy link
Member

tomchristie commented Nov 9, 2015

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?

@mjschultz
Copy link
Contributor Author

mjschultz commented Nov 9, 2015

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
Copy link
Collaborator

xordoquy commented Jan 19, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants