A Python implementation of John Gruber’s Markdown with Extension support.
striptags
is provided to convert headings to plain text.
Unlike, the markupsafe
implementation, HTML entities are not unescaped.name
, rich html
, and unescaped raw data-toc-label
are
saved to toc_tokens
, allowing users to access the full rich text content of
the headings directly from toc_tokens
.data-toc-label
is sanitized separate from heading content
before being written to name
. This fixes a bug which allowed markup through
in certain circumstances. To access the raw unsanitized data, retrieve the
value from token['data-toc-label']
directly.html.unescape
call is made just prior to calling slugify
so that
slugify
only operates on Unicode characters. Note that html.unescape
is
not run on name
, html
, or data-toc-label
.get_name
and stashedHTML2text
defined in the toc
extension
are both deprecated. Instead, third party extensions should use some
combination of the new functions run_postprocessors
, render_inner_html
and
striptags
.scripts/*.py
in the generated source tarballs (#1430).^
) and square brackets (]
) but explicitly exclude
backslashes (\
) from abbreviations (#1444).attr_list
, fenced_code
), quoted attribute values are
now allowed to contain curly braces (}
) (#1414).convertFile
- it accepts only bytes-based buffers.
Also remove legacy checks from Python 2 (#1400)AdmonitionProcessor.content_indent
unset
(#1404)InlineProcessor
with AtomicString
(#1406).codehilite
with an empty code
tag (#1405).