Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lepture/mistune
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.3.2
Choose a base ref
...
head repository: lepture/mistune
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.3.3
Choose a head ref
  • 20 commits
  • 22 files changed
  • 6 contributors

Commits on Jun 17, 2026

  1. Fix MarkdownRenderer re-rendering of code spans containing backticks

    MarkdownRenderer.codespan always wrapped the content in a single backtick
    pair, so a code span whose content contains backticks re-parsed wrong: the
    inner backtick closed the span early, and a lone backtick rendered as an
    empty fenced code block.
    
    Size the delimiter to one more than the longest backtick run in the content,
    and pad with a space on each side when the content begins or ends with a
    backtick (the parser strips that padding back off), matching parse_codespan
    and CommonMark.
    binggao1230 committed Jun 17, 2026
    Configuration menu
    Copy the full SHA
    f6827e8 View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2026

  1. fix(inline): use original run length in emphasis multiple-of-3 rule

    CommonMark rules 9 and 10 require the multiple-of-3 delimiter test to use
    the lengths of the original delimiter runs, not the lengths remaining after
    a run has been partially consumed. mistune mutated _Delimiter.length as it
    consumed markers and then reused that mutated value in the mod-3 test, so the
    leftover of a partially consumed run (e.g. the ** left after *a* closes in
    '*a***a*') could no longer match a later delimiter.
    
    Track the original run length on _Delimiter and use it in
    _can_match_emphasis_delimiters. Fixes cases such as '*a***a*' and
    '*foo***bar*', which two CommonMark reference implementations
    (markdown-it-py, commonmark.py) render as <em>a</em>*<em>a</em> and
    <em>foo</em>*<em>bar</em>.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
    mahirhir and claude committed Jun 25, 2026
    Configuration menu
    Copy the full SHA
    2d26bc8 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2026

  1. Merge pull request #458 from greymoth-jp/fix/emphasis-mod3-original-l…

    …ength
    
    Fix emphasis multiple-of-3 rule mis-rendering (e.g. *foo***bar*)
    lepture authored Jun 26, 2026
    Configuration menu
    Copy the full SHA
    fc15c87 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #450 from gaoflow/fix-markdown-codespan-backticks

    Fix MarkdownRenderer re-rendering of code spans containing backticks
    lepture authored Jun 26, 2026
    Configuration menu
    Copy the full SHA
    10c918d View commit details
    Browse the repository at this point in the history
  3. fix: set prev token in render_list_item and add block_text to ignore_…

    …blocks (#456)
    
    * fix: set prev token in render_list_item and add block_text to ignore_blocks
    
    The RSTRenderer.block_quote method accesses token.prev to decide
    whether to emit a .. separator before the blockquote.  When a
    blockquote appears inside a list item, render_list_item called
    renderer.render_token directly without tracking prev, so
    blockquote tokens never received a prev reference.  This caused a
    KeyError in older versions and silently degraded output in the
    current version (missing or incorrect .. separators).
    
    - Track prev in render_list_item, mirroring how RSTRenderer.iter_tokens
      already does for top-level tokens.
    - Add block_text (the list-internal paragraph token type) to the
      ignore_blocks tuple so a blockquote following list-internal text
      does not get a spurious .. separator.
    
    * Test RST list item blockquote separation
    binggao1230 authored Jun 26, 2026
    Configuration menu
    Copy the full SHA
    0799e19 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2026

  1. Escape quotes in MarkdownRenderer link and image titles

    A title containing a double quote was emitted unescaped inside double
    quotes, e.g. [t](/u 'a"b') re-rendered as [t](/u "a"b"). On a
    re-parse the embedded quote closes the title early, so the title is
    silently dropped (or the link fails to parse). Escape backslashes and
    the closing quote when writing inline-link, image and reference-link
    titles so they survive a round trip.
    sarathfrancis90 committed Jun 27, 2026
    Configuration menu
    Copy the full SHA
    2c1a518 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #459 from sarathfrancis90/fix/markdown-renderer-li…

    …nk-title-quote
    
    Escape quotes in MarkdownRenderer link and image titles
    lepture authored Jun 27, 2026
    Configuration menu
    Copy the full SHA
    ecd435a View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2026

  1. Keep a trailing '>' when reformatting block quotes

    MarkdownRenderer.block_quote indented every line with '> ' (including the
    blank line a paragraph leaves behind) and then ran rstrip('> \n') to drop
    that dangling marker. Because rstrip strips a character set, it also ate a
    '>' that ended the quote's own content, so an autolink, an inline HTML tag,
    or a literal '>' lost its final character (e.g. '> <https://x.com>' became
    '> <https://x.com', which reparses as escaped text).
    
    Strip the children's trailing blank lines before indenting instead, so the
    marker is never added to an empty trailing line and there is nothing to peel
    back off.
    sarathfrancis90 committed Jun 28, 2026
    Configuration menu
    Copy the full SHA
    cff35d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    59c35e2 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2026

  1. Configuration menu
    Copy the full SHA
    fe02f40 View commit details
    Browse the repository at this point in the history
  2. fix: escape literal emphasis markers in MarkdownRenderer

    MarkdownRenderer.text() only escaped backticks, so a text token that is a
    literal "*"/"_" emphasis delimiter was emitted unescaped and re-parsed as
    emphasis on the round-trip. This silently changed the document's meaning,
    violating the invariant asserted by TestMarkdownRendererRoundTrip
    ("reformatting valid Markdown must not change its meaning").
    
    An escaped marker in the source (``\*not emphasis\*``) is stored by the
    inline parser as bare "*" text tokens (the backslash is consumed and the
    parser's internal no-emphasis flag is dropped before the AST). Re-emitting
    those tokens without a backslash let them pair up again:
    
        reformat(r"\*not emphasis\*")  ->  "*not emphasis*"
        html(reformat(...))            ->  "<p><em>not emphasis</em></p>"   # was <p>*not emphasis*</p>
    
    The same happened for "_", "**"/"__", and unmatched leftover markers.
    
    Fix: in text(), if a text token consists entirely of "*"/"_" it is a
    literal delimiter (an escaped marker or an unmatched leftover), so
    backslash-escape each character. Prose punctuation such as "2 * 3" or
    "snake_case" always arrives mixed with other characters, so it is left
    untouched and is not over-escaped (guarded by the existing
    test_prose_not_over_escaped and a new test_real_emphasis_not_over_escaped).
    
    Added test_escaped_emphasis_markers and test_real_emphasis_not_over_escaped
    to TestMarkdownRendererRoundTrip. The regression test fails without the
    source change (asserts <em>...</em> reappears) and passes with it; full
    suite 1122 passed, ruff check/format and mypy clean.
    Sanjays2402 committed Jul 3, 2026
    Configuration menu
    Copy the full SHA
    b042996 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2026

  1. Configuration menu
    Copy the full SHA
    3025549 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2026

  1. Configuration menu
    Copy the full SHA
    4009f67 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9946c92 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2026

  1. fix: add max_emphasis_depth

    lepture committed Jul 9, 2026
    Configuration menu
    Copy the full SHA
    0938fb7 View commit details
    Browse the repository at this point in the history
  2. fix: add image max depth

    lepture committed Jul 9, 2026
    Configuration menu
    Copy the full SHA
    cca5ee6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e001d51 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c2228a2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ae7e9d5 View commit details
    Browse the repository at this point in the history
  6. chore: release 3.3.3

    lepture committed Jul 9, 2026
    Configuration menu
    Copy the full SHA
    060f73a View commit details
    Browse the repository at this point in the history
Loading