Python-Markdown 3.2 Release Notes¶
Python-Markdown version 3.2 supports Python versions 3.5, 3.6, 3.7, 3.8, and PyPy3.
Drop support for Python 2.7¶
Python 2.7 reaches end-of-life on 2020-01-01 and Python-Markdown 3.2 has dropped support for it. Please upgrade to Python 3, or use Python-Markdown 3.1.
strong inline processor changes¶
In order to fix issue #792,
strong inline processors were refactored. This
translated into removing many of the existing inline processors that handled this
These processors were replaced with two new ones:
legacy_em extension was also modified with new,
refactored logic and simply overrides the
em_strong2 inline processor.
CodeHilite now always wraps with
Before, the HTML generated by CodeHilite looked like:
<pre><code>foo = 'bar'</code></pre> if you were not using Pygments.
<pre>foo = 'bar'</pre> if you were using Pygments.
To make the cases more consistent (and adhere to many Markdown specifications and
HTML code block markup suggestions), CodeHilite will now always additionally wrap
<code> tags. See #862 for more details.
This change does not alter the Python-Markdown API, but users relying on the old markup will find their output now changed.
Internally, this change relies on the Pygments 2.4, so you must be using at least that version to see this effect. Users with earlier Pygments versions will continue to see the old behavior.
Previously, Python-Markdown was using either the
xml.etree.ElementTree module, based on their availability. In modern
Python versions, the former is a deprecated alias for the latter. Thus, the
compatibility layer is deprecated and extensions are advised to use
xml.etree.ElementTree directly. Importing
markdown.util.etree will raise
DeprecationWarning beginning in version 3.2 and may be removed in a future
Therefore, extension developers are encouraged to replace
from markdown.util import etree with
import xml.etree.ElementTree as etree in their code.
The following new features have been included in the release:
Some new configuration options have been added to the toc extension:
permalink_classoptions allow class(es) to be assigned to the
permalinkrespectively. This allows using icon fonts from CSS for the links. Therefore, an empty string passed to
permalinknow generates an empty
permalink. Previously no
permalinkwould have been generated. (#776)
permalink_titleoption allows the title attribute of a
permalinkto be set to something other than the default English string
Permanent link. (#877)
Document thread safety (#812).
Markdown parsing in HTML has been exposed via a separate extension called
Add support for Python 3.8.
The following bug fixes are included in the 3.2 release:
- HTML tag placeholders are no longer included in
- Unescape backslash-escaped characters in TOC ids (#864).
- Refactor bold and italic logic in order to solve complex nesting issues (#792).
- Always wrap CodeHilite code in