unstale

pypi / myst-parser

myst-parser

What changed in myst-parser 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

15 breaking1 security1 deprecations6 new APIs and options7 behavior and defaults15 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

myst-parser 541 changes

Breaking changes 12

  • Directives now receive the full fenced text, matching reStructuredText, so errors that echo it show the whole fence.

    5.2.0release notes

  • The offset is now -1 when a directive body starts on the opening line.

    5.2.0release notes

  • heading_slug_func, update_mathjax, mathjax_classes, suppress_warnings, and inventories in document front matter now warn and are ignored.

    5.2.0release notes

  • Duplicate heading slugs now use fixed-base suffixes such as x, x-1, x-2; links to old third-or-later duplicate slugs no longer resolve.

    5.2.0release notes

  • Image alt text preserves backslash escapes and entities; HTML image alt text is kept exactly, and a valueless alt is empty rather than None.

    5.2.0release notes

  • myst-parser and myst-docutils now require mdit-py-plugins>=0.7,<1.

    5.2.0release notes

  • Each line now retains its indentation, and two trailing spaces no longer create a hard line break.

    5.2.0release notes

  • Warnings and nodes now report corrected source lines, including text nodes, included files, and directive bodies; gettext .pot locations can change.

    5.2.0release notes

  • Requires docutils >=0.20,<0.23, dropping 0.19 and allowing 0.22.

    5.0.0release notes

  • Updates the required markdown-it-py version to ~=4.0 from v3.

    5.0.0release notes

  • Requires Python >=3.11, dropping Python 3.10, and adds support for Python 3.14.

    5.0.0release notes

  • Requires Sphinx >=8,<10, dropping Sphinx 7 and adding Sphinx 9 support.

    5.0.0release notes

Security 1

  • Deeply nested HTML, malformed or hostile YAML front matter, and YAML alias bombs now warn instead of aborting the build.

    5.2.0release notes

Deprecations 1

  • Deprecated in favor of myst_parser.slugs.github_slugify.

    5.2.0release notes

New APIs and options 6

  • A document's own front matter is now available to its substitutions as env.metadata[env.docname].

    5.2.0release notes

  • Adds --slug-func to select the slug function used by the command.

    5.2.0release notes

  • Emits heading slugs as secondary HTML ids so fragment links using the slug work in published HTML; set it to False to emit only the docutils id.

    5.2.0release notes

  • Supports named heading slug presets: github, gitlab, and docutils.

    5.2.0release notes

  • A shared slug module provides heading slug implementations, including the GitHub, GitLab, and docutils presets.

    5.2.0release notes

  • Adds a syntax extension for section-sign references such as §1.1, linking to the correspondingly numbered heading in the current document.

    5.2.0release notes

Behavior and default changes 7

  • Warnings point to the offending option's line, and unknown options are reported in separate warnings rather than one aggregate warning.

    5.2.0release notes

  • The supported docutils range is widened to >=0.20,<0.24, including support for docutils 0.23.

    5.2.0release notes

  • An explicit (target)= before a heading becomes the section's primary id, while the implicit heading id remains a secondary anchor.

    5.2.0release notes

  • A {table} caption can now wrap onto following lines.

    5.2.0release notes

  • The mode now includes GFM autolinks and alerts, with improved strikethrough and tasklist handling.

    5.1.0release notes

  • Warnings now use the docname instead of the source path in their locations.

    5.1.0release notes

  • Improves generation of meta nodes.

    5.0.0release notes

Fixes and other changes 14

  • Invalid aliased image attributes such as {w=…} now produce a warning instead of raising.

    5.2.0release notes

  • Link titles are now preserved when links pass through cross-reference resolution.

    5.2.0release notes

  • Links such as [](doc.md#label) now resolve to explicit targets in other documents without a false missing-reference warning, using the target's title as link text.

    5.2.0release notes

  • A footnote whose label equals a heading's name is retained instead of being dropped with a warning.

    5.2.0release notes

  • Previously unresolved same-document and cross-document links now resolve when their implicit anchor exists; cross-document label links use the target's title as link text.

    5.2.0release notes

  • When linkify-it-py is not installed, linkify is disabled with a myst.linkify warning instead of crashing.

    5.2.0release notes

  • Blank lines at the start and end of math block content are removed, fixing LaTeX output.

    5.2.0release notes

  • Writes the correctly spelled rel="noreferrer" and no longer overwrites an authored target or rel.

    5.2.0release notes

  • Can now run twice, allowing both myst_parser and myst_nb to be listed in Sphinx extensions.

    5.2.0release notes

  • Remote inventory fetches now send a User-Agent, avoiding HTTP 403 responses from Read the Docs.

    5.2.0release notes

  • Substitution keys that are not Jinja2 identifiers, such as {{foo-bar}}, are now allowed.

    5.2.0release notes

  • Parsing now stops at colon fences, fixing nested colon fence directives.

    5.1.0release notes

  • Ampersands in Markdown URLs are correctly encoded by not HTML-escaping refuri.

    5.1.0release notes

  • Improves MathJax 4 compatibility for Sphinx 9.

    5.1.0release notes

myst-parser 44 changes

Breaking changes 3

Fixes and other changes 1

  • Footnote definition and reference warnings and translations are improved.

    4.0.0release notes