Changelog — Python-Markdown 3.8 documentation (original) (raw)

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning. See the Contributing Guide for details.

[3.8.0] - 2025-04-09

Changed

Fixed

[3.7.0] - 2024-08-16

Changed

Fixed

[3.6.0] - 2024-03-14

Changed

Fixed

[3.5.2] - 2024-01-10

Fixed

[3.5.1] - 2023-10-31

Fixed

[3.5.0] - 2023-10-06

Added

Changed

Fixed

[3.4.4] - 2023-07-25

Fixed

[3.4.3] - 2023-03-23

Fixed

[3.4.2] - 2023-03-22

Fixed

[3.4.1] - 2022-07-15

Fixed

[3.4.0] - 2022-07-15

Changed

from markdown.extensions.tables import TableExtension  
markdown.markdown(src, extensions=[TableExtension(use_align_attribute=True)])  

Added

Fixed

[3.3.7] - 2022-05-05

Fixed

[3.3.6] - 2021-11-17

Fixed

[3.3.5] - 2021-11-16

Fixed

[3.3.4] - 2021-02-24

Fixed

[3.3.3] - 2020-10-25

Fixed

[3.3.2] - 2020-10-19

Fixed

[3.3.1] - 2020-10-12

Fixed

[3.3.0] - 2020-10-06

Changed

from markdown.extensions.fenced_code import FencedCodeExtension  
markdown.markdown(src, extensions=[FencedCodeExtension(lang_prefix='')])  

Note
When code highlighting isenabled, the output from Pygments is used unaltered. Currently, Pygments does not provide an option to include the language class in the output, let alone prefix it. Therefore, any language prefix is only applied when syntax highlighting is disabled.

Added

Fixed

[3.2.2] - 2020-05-08

Fixed

[3.2.1] - 2020-02-12

Fixed

[3.2.0] - 2020-02-07

Changed

Added

Fixed

[3.1.1] - 2019-05-20

Fixed

[3.1.0] - 2019-03-25

Changed

Added

Fixed

[3.0.1] - 2018-09-28

Fixed

[3.0.0] - 2018-09-21

Changed

html = markdown.markdown(text, safe_mode=True)  

Then it is recommended that you change your code to read something like this:

import bleach  
from bleach_whitelist import markdown_tags, markdown_attrs  
html = bleach.clean(markdown.markdown(text), markdown_tags, markdown_attrs)  

If you are not interested in sanitizing untrusted text, but simply desire to escape raw HTML, then that can be accomplished through an extension which removes HTML parsing:

from markdown.extensions import Extension  
class EscapeHtml(Extension):  
    def extendMarkdown(self, md):  
        md.preprocessors.deregister('html_block')  
        md.inlinePatterns.deregister('html')  
html = markdown.markdown(text, extensions=[EscapeHtml()])  

As the HTML would not be parsed with the above Extension, then the serializer will escape the raw HTML, which is exactly what happened in previous versions with safe_mode="escape".

html = markdown.markdown(text, [SomeExtension()])  

Then it is recommended that you change it to read something like this:

html = markdown.markdown(text, extensions=[SomeExtension()])  

Note
This change is being made as a result of deprecating "safe_mode" as thesafe_mode argument was one of the positional arguments. When that argument is removed, the two arguments following it will no longer be at the correct position. It is recommended that you always use keywords when they are supported for this reason.

Added

Previous Releases

For information on prior releases, see their changelogs: