unstale

pypi / pygments

pygments

What changed in pygments 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

3 breaking3 security13 new APIs and options1 performance24 behavior and defaults1 tooling64 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

pygments 2109 changes

Breaking changes 3

  • Renders double and single quotation marks literally.

    2.21.0release notes

  • Python 3.8 is no longer supported, and Python 3.14 is now supported.

    2.20.0release notes

  • The Coq lexer has been renamed to Rocq.

    2.20.0release notes

Security 3

New APIs and options 13

Performance 1

  • Entry points are cached to improve performance.

    2.20.0release notes

Behavior and default changes 24

Tooling 1

Fixes and other changes 64

  • Fixes colored keyword highlighting at the beginning of a name.

    2.21.0release notes

  • Adds missing Boogie and Civl Verifier keywords to highlighting.

    2.21.0release notes

  • Recognizes interpolated verbatim strings with either $@ or @$ prefixes.

    2.21.0release notes

  • Highlights a function following a namespace body.

    2.21.0release notes

  • Fixes lexer support for multiline pre-processor comments.

    2.21.0release notes

  • Recognizes union as a keyword.

    2.21.0release notes

  • Recognizes named, octal and Unicode character literals such as \space and \o377 as single tokens.

    2.21.0release notes

  • Adds a missing opcode parameter type letter.

    2.21.0release notes

  • Fixes single-quote backslash escaping.

    2.21.0release notes

  • Includes various lexer improvements.

    2.21.0release notes

  • Requires a word break after SET.

    2.21.0release notes

  • Avoids duplicating a character when wrapping a token that is not at the end of a line.

    2.21.0release notes

  • Matches only valid digits.

    2.21.0release notes

  • Improves handling of non-string types to fix broken clients.

    2.21.0release notes

  • Highlights the arguments object.

    2.21.0release notes

  • Recognizes colons in array slice expressions.

    2.21.0release notes

  • Allows apostrophes in element text.

    2.21.0release notes

  • Fixes backslash handling in rstrings.

    2.21.0release notes

  • Supports companion objects without an explicit name.

    2.21.0release notes

  • Prevents a nullable type marker from consuming the following character, so Foo?, and a?:b tokenize correctly.

    2.21.0release notes

  • Recognizes member-access dots in dynamic objects.

    2.21.0release notes

  • Invalid -L values no longer report success.

    2.21.0release notes

  • Honors the wrapped lexer's stripnl and other input options when escapeinside is set, so blank lines are no longer stripped under stripnl=false.

    2.21.0release notes

  • Includes various lexer improvements.

    2.21.0release notes

  • Updates recognized symbols to 1.26.05.

    2.21.0release notes

  • Highlights bold-italics written as ***...*** and ___...___.

    2.21.0release notes

  • Fixes wrong token offsets for embedded code blocks.

    2.21.0release notes

  • Supports hyphens in usernames matched by the mention regex.

    2.21.0release notes

  • Recognizes named-character escapes such as \[Nu] instead of emitting an Error token.

    2.21.0release notes

  • Allows ... line continuations in function definition signatures.

    2.21.0release notes

  • Requires a word break after SET.

    2.21.0release notes

  • Adds more keywords.

    2.21.0release notes

  • Recognizes sentinel.

    2.21.0release notes

  • Adds support for Python 3.15.

    2.21.0release notes

  • Recognizes frozendict.

    2.21.0release notes

  • Recognizes lazy imports.

    2.21.0release notes

  • Fixes a crash when error_color is set.

    2.21.0release notes

  • Stops duplicating the body of an unterminated heredoc.

    2.21.0release notes

  • Treats << after ), ] or } as the shift operator rather than the start of a heredoc.

    2.21.0release notes

  • Recognizes variable references in property values.

    2.21.0release notes

  • Fixes text blocks and adds missing syntax.

    2.21.0release notes

  • Keeps func a keyword in class func type methods.

    2.21.0release notes

  • Stops $name variable references at a dash.

    2.21.0release notes

  • Recognizes LaTeX math environments as math.

    2.21.0release notes

  • Treats module as a keyword only when followed by whitespace, so identifiers such as modules and module.exports are highlighted correctly.

    2.21.0release notes

  • Recognizes verbatim strings before ordinary quoted strings.

    2.21.0release notes

  • Includes small improvements to the VimScript lexer.

    2.21.0release notes

  • Recognizes sign-extension operators.

    2.21.0release notes

  • Marks SVG files as XML.

    2.21.0release notes

  • Recognizes non-breaking spaces as valid scalar content.

    2.21.0release notes

  • The lexer recognizes the minus sign and correctly handles the range operator.

    2.20.0release notes

  • autopygmentize has various improvements.

    2.20.0release notes

  • The lexer fixes analyse_text.

    2.20.0release notes

  • The Cython lexer has various improvements.

    2.20.0release notes

  • Architecture parsing is improved.

    2.20.0release notes

  • The Fennel lexer has various improvements.

    2.20.0release notes

  • The lexer handles escape sequences in character literals.

    2.20.0release notes

  • The kwargs dictionary is no longer mutated on each call.

    2.20.0release notes

  • The lexer is updated for Macaulay2 1.25.05 and 1.25.11.

    2.20.0release notes

  • The Mathematica lexer has various improvements.

    2.20.0release notes

  • Namespace tokenization is fixed.

    2.20.0release notes

  • The lexer no longer enters an infinite loop.

    2.20.0release notes

  • The lexer allows empty comment lines.

    2.20.0release notes

  • The color table is fixed.

    2.20.0release notes