Repository navigation
Update dependency markdown-it-py to >=4.3.0 - #286
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
=======================================
Coverage 55.05% 55.05%
=======================================
Files 33 33
Lines 4299 4299
=======================================
Hits 2367 2367
Misses 1932 1932 🚀 New features to boost your workflow:
|
olehermanse
requested review from
aleksandrychev,
craigcomstock,
larsewi and
victormlg
November 11, 2026 10:50
larsewi
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=4.2.0→>=4.3.0Release Notes
executablebooks/markdown-it-py (markdown-it-py)
v4.3.0Compare Source
This release fixes two quadratic-time parsing paths that let crafted input stall rendering for minutes (security),
aligns several parsing rules with CommonMark 0.31.2 and markdown-it 15.0.x,
turns parser rules that never advance into a
RuntimeErrorinstead of an infinite loop,makes rendering linear on PyPy and free-threaded CPython, and adds support for Python 3.14.
Python 3.10 is still supported.
If you write plugins or render rules, or edit
SyntaxTreeNodetrees, please read the upgrade notes at the end.🔒 Security
&,<,~or incomplete entities), which let a few hundred kilobytes of input stall rendering for seconds to minutes, in #423, thanks to @hdimer (#411)<!--,<?,<![CDATA[,<!X) in constant time whenhtmlis enabled (as in the defaultcommonmarkpreset), instead of rescanning to the end of the input for every opener, in #428✨ New
--enable-tablesto the CLI for file, standard input and interactive parsing in #425, thanks to @user01010111 (#422); requested by @hartwork in #352👌 Improved
RuntimeErrorinstead of looping forever when a block or inline rule reports a match without advancing (or moves backwards), or when no block rule matches a line, as markdown-it does, in #444, thanks to @rupayon123, @hukkin (#336) and @inchang-ing (#443); requested by @acaprino in #441StateBase.srca plain attribute, for about 4–11% faster parsing on CPython, in #450, thanks to @deadstrobe5-htext in #463🐛 Fixed
script/pre/style/textarea) ending at a blank line inside a list item or blockquote, porting markdown-it 14.2.0, in #406, thanks to @binggao1230; reported by @Jayman2000 in #377<!doctype html>start a block and interrupt a paragraph, and tag names match case-insensitively in ASCII only, in #440, thanks to @rupayon123; reported by @p5ych0 in #437http://[::1]:8000/) in normalized link and image URLs, porting markdown-it 15.0.1, in #459, thanks to @Jinyong-Li[ ]/[x]at the start of an indented code block in a list item in #451, thanks to @AryanRGIndexErrorin thehtml_blockandheadingrules at the end of the input (a table in a blockquote that ends on>) in #416, thanks to @saket3395; reported by @WilcoPancras in #415givesalt="a * b"), porting markdown-it 15.0.0, in #446, thanks to @gyanu2507; reported by @kdeldycke in #445SyntaxTreeNode.to_tokens()in #453, thanks to @KennyMcSimpson; edited tokens are copied, so the token stream the tree was built from is left unchanged (#464)Ruler.enable,disableorenableOnlyraised on an unknown rule name in #457, thanks to @IlyaKhalafi; reported in #456MarkdownIt.enable()anddisable()applying a generator of rule names only to the core chain in #447, thanks to @muneikh📚 Documentation
RendererProtocolfor writing your own renderer, in #463MarkdownItpasses itself torenderer_cls, unlike markdown-it's renderer constructor, in #421, thanks to @user01010111add_render_rulemust match a token type in #432, thanks to @hikmetba-bit🔧 Maintenance
python -m buildand checked on every pull request, in #397 and #461tests/in the sdist (next totox.iniandCHANGELOG.md), so packagers can run the test suite from it, in #426, thanks to @BetterAndBetterII (#420), and #461; requested by @mtelka in #261coverageandpytest-covfrom thetestingextra to a newcoverageextra, and skip the linkify tests when linkify-it-py is not installed, in #463; requested by @befeleme in #195commonmarkpackage from thecompareextra in #427, thanks to @nikolas (#401)Upgrade notes
A block or inline rule that returns
Truewithout movingstate.lineorstate.posforward now raisesRuntimeError(block rule didn't increment state.line,inline rule didn't increment state.pos), where it used to hang.So does a line that no block rule accepts, which is only possible with the
paragraphrule disabled (none of the block rules matched).childrenhold joinedtexttokens.As in markdown-it 15,
text_joinnow also joins thetext_specialtokens among an image token'schildren, so code that reads alt text from them gets escaped characters and entities as plaintexttokens (a nested image's ownchildrenare still not joined, as upstream).str.The rendered fragments are now joined with
str.join, so a rule that returns astrsubclass (such asmarkupsafe.Markup) gives a plainstrfromrender(), and any non-strresult (even one that defines__radd__, which 4.2.0 let through) raisesTypeErrorwhen the fragments are joined.SyntaxTreeNode.to_tokens()follows the tree.The tree's
childrenare the source of truth: a change made directly to a token'schildrenlist no longer appears in the output, andto_tokens()does not modify the token stream the tree was built from.MarkdownIt.enable()ordisable()are validated like a list, so an unknown name now raisesValueError.StateInline.pendingis now a property backed by a buffer:state.pending += textstill works, and the newstate.append_pending(text)appends in constant time.HTML_TAG_RE(markdown_it.common.html_re) andDIGITAL_REandNAMED_RE(markdown_it.rules_inline.entity) no longer start with^, because they are applied with.match(src, pos); code that calls.search()on them now matches anywhere in the string.The private
StateBase._srcand_srcCharCodeattributes are gone (srcCharCodeitself is still there, and still deprecated).The
testingextra no longer installscoverageandpytest-cov: install.[testing,coverage]to run the tests with--cov.The sdist now contains
tests/, and no longer contains repository files such as.github/,.pre-commit-config.yamlandscripts/.Full Changelog: executablebooks/markdown-it-py@v4.2.0...v4.3.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.