Repository navigation
chore(deps): update dependency mdit-py-plugins to v0.7.0 - #325
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
An organization admin can view or raise the monthly spending cap at claude.ai/admin-settings/usage, on the Claude Code Review row under Services. The cap resets at the start of the next billing period.
Once the cap resets or is raised, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
This branch has not been deployed
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:
==0.6.1→==0.7.0Release Notes
executablebooks/mdit-py-plugins (mdit-py-plugins)
v0.7.0Compare Source
A security and bug-fix release.
Plugin renderers now escape user content in HTML attribute, label and math positions,
attrsdrops event-handler attributes by default and validates URL-valued attributes,and the regular expressions in
texmath```mathblocks andadmonheaders no longer backtrack polynomially (#143).It also fixes parser hangs in
gfm_autolink(#160) andtexmath(#156),and adds the
section_refplugin.The release requires markdown-it-py >= 3.0 and supports Python 3.10 to 3.14.
Several fixes change rendered output: see Upgrade notes below.
Upgrade notes
The declared floor was 2.0, but 0.5.0 and later already failed to import
subscriptwith markdown-it-py 2.x.section_ref,gfmandgfm_autolinkstill need markdown-it-py >= 4.1 and raiseRuntimeErroron older versions.Python 3.10 to 3.14 are supported.
attrs_plugin/attrs_block_plugindefaults are stricter (#150).With no
allowedlist, event-handler attributes (any key starting withon, in any case) are removedand moved to
token.meta["insecure_attrs"];styleis kept.Whatever
allowedsays,href,src,action,formactionandxlink:hrefare removed whenmd.validateLinkrejects their value,so
[a](https://x){href="javascript:alert(1)"}keepshref="https://x".Text spans (
[text]{...}) now honourallowed, which they used to bypass.This is a baseline, not a sanitiser: for untrusted input, pass an explicit list such as
allowed=("id", "class").The
texmathdefault renderer HTML-escapes the math source ($a<b$now renders<eq>a<b</eq>),and the
dollarmathequation label, themyst_blocktarget label, thecolon_fenceclass nameand the
tasklistslabel_afterlabel are escaped too.Benign text containing
&,<,>or"in these positions is now emitted as entities.anchors_pluginids can change (#159).An explicit heading id (such as
{#custom}fromattrs_block_plugin) is now kept instead of being overwritten,and generated slugs avoid it.
The default slug function no longer strips whitespace from the title,
matching MyST-Parser's
github_slugify:a title that starts or ends with a space next to an image, raw HTML or an entity gets a different id
(
# Foo now givesfoo-, it wasfoo).To keep the old ids, pass
slug_func=lambda title: slugify(title.strip()), withslugifyfrommdit_py_plugins.anchors.index.mdit_py_plugins.attrs.parse.parse()raises on an unterminated attribute group, instead of succeeding at the end of the string(#153).
Every plugin call site declines the group, so
`a`{.anow renders<code>a</code>{.a; it used to drop the{.a.section_reftoken shape is public API (#169): see its entry below.🔒 Security
Thanks to @KrisKennawayDD for reporting these issues in #143,
and to @KyleKing for the ReDoS analysis and fixes.
🔒 FIX: Escape plugin renderer output and harden the
attrsdefaults, thanks to @KyleKing for the cross-plugin XSS test (#150, folding in #151)With markdown-it-py's
htmloption off, untrusted Markdown could still inject HTML or script through:the
texmathdefault renderer (math source), thedollarmathequation label (idand permalinkhref),the
myst_block(name)=target label, andattrs/attrs_blockevent-handler andjavascript:URL attributes.All of these are now escaped or filtered (see Upgrade notes),
and
tests/test_xss.pyrenders injection probes through each plugin's default renderer.🔒 FIX: Escape the
colon_fenceclass name and thetasklistslabel_afterlabel (#165):::a"onmouseover="alert(1)rendered an attribute-breakingclass="block-a"onmouseover="alert(1)",and
- [ ] <img src=x onerror=alert(1)>withlabel=True, label_after=Truerendered a raw<img>.🔒 FIX: ReDoS in
texmath```mathblocks andadmonheaders, thanks to @KyleKing (#148)The
texmath```mathpatterns (thegitlabandjuliadelimiters) backtracked cubicallyon a fence followed by a long whitespace run with no closing fence,
and the
admonmulti-tag title pattern backtracked quadratically on a header with a long run of spaces or double quotes.Both now run in linear time and match what they matched before, so output is unchanged.
✨ New
✨ NEW: Add the section reference plugin (
section_ref) (#144, #168, #169)The
section_refplugin captures section-sign references, the syntax LLMscommonly use to point at numbered headings, into dedicated
section_reftokens,so downstream renderers (e.g. MyST-Parser) can resolve them to heading cross-references:
A
§must be immediately followed by one or more.-separated levels of 1 to 9 ASCII digits, with no spaces.A trailing
.is not part of the reference, and a reference directly followed by an ASCII letter (§1a),or with a level longer than nine digits, stays literal text.
Each reference is a
section_refleaf token whosecontentis the text as writtenand whose
meta["numbers"]lists each level as an int (e.g.[1, 1]for§1.1).The grammar and the token shape are documented in the plugin docstring and are public API from this release.
It renders as
<span class="section-ref">§1.1</span>by default.Requires markdown-it-py >= 4.1.0.
🐛 Fixes
🐛 FIX:
gfm_autolinkno longer hangs on autolink-like text in link labels (#160), thanks to @AryanRG (#161)🐛 FIX:
texmathno longer loops forever on block math opened in a blockquote and closed after it (#156), thanks to @acaprino (#157)🐛 FIX:
dollarmath: a same-line$$…$$followed by text no longer swallows the following lines (#147), thanks to @KyleKing (#149)🐛 FIX:
dollarmath: multi-line$$blocks in a blockquote no longer keep the>prefixes in their content (#125), thanks to @BetterAndBetterII (#152)🐛 FIX:
front_matter: parse front matter closed by the YAML...document-end marker, thanks to @feiiiiii5 (#158)A block closed by
...used to leak into the document as text when the...was the document's last line or had trailing spaces,and otherwise kept the
...intoken.content.The marker must be at column 0 and may be followed by spaces only.
🐛 FIX:
footnote: reserve an inline footnote's id before parsing its content, thanks to @civilwarinfrance (#162)A
[^named]reference or a nested^[...]inside an inline footnote no longer loses the inner note, duplicates an id, or raisesKeyError: 'count'.🐛 FIX:
anchors: keep explicit heading ids, and do not strip slug titles, thanks to @muneikh (#159)🐛 FIX:
attrs: unterminated groups, class accumulation and closing-token merge (#153)An unterminated attribute group no longer swallows the text after it.
Classes from adjacent attribute groups are combined on spans and links (
[a]{.x}{.y}givesclass="x y"),as they already were on inline code and images.
An attributes block at the end of a container is no longer merged onto the closing token
(
> {.a}rendered</blockquote class="a">).🐛 FIX:
myst_roleno longer rejects a role at the start of inline content when the content ends with a backslash,and
\\{name}`x`(an escaped backslash before a role) now parses the role (#62) (#145)📚 Documentation
dollarmathrendering contract and a "Rendering dollarmath output" guide (#111),and Read the Docs builds on Python 3.13 (#166)
🔧 Maintenance
from distributions built with
python -m buildand checked on every pull request (#164)and a non-blocking Codecov upload (#167)
Full Changelog: executablebooks/mdit-py-plugins@v0.6.1...v0.7.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 was generated by Mend Renovate. View the repository job log.