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 initpygments 2109 changes
Breaking changes 3
Renders double and single quotation marks literally.
Python 3.8 is no longer supported, and Python 3.14 is now supported.
The Coq lexer has been renamed to Rocq.
Security 3
Fixes catastrophic backtracking in looks_like_xml.
GUID and ID patterns no longer cause catastrophic backtracking.
The lexer no longer causes catastrophic backtracking.
New APIs and options 13
Adds a lexer for BitBake.
Adds a lexer for Caddyfile.
Adds a lexer for CEL.
Adds .ipp as a recognized C/C++ file extension.
Adds the Night Owl style.
Adds a lexer for PureScript.
Allows transparent as a color style definition.
Adds yml as an alias.
The lexer supports overlay/fragments and bytestrings.
The lexer recognizes the operators ]', ]?, and ]!.
A Rell lexer is available for highlighting Rell code.
The lexer recognizes commands introduced in versions 5.3 through 5.6.
The .xbrl file ending is recognized.
Performance 1
Entry points are cached to improve performance.
Behavior and default changes 24
Adds highlighting for C23/C++26 attributes.
Adds more C2Y keywords.
Supports dollar-prefixed and multi-quote raw strings.
Derives from the C++ lexer instead of C, highlighting C++ constructs such as template, class and namespace.
Allows non-ASCII Unicode identifiers.
Improves the monokai theme colors.
Allows . and + in directive and role names.
Recognizes chevron prompts.
Allows uppercase letters at the start of identifiers.
Recognizes conditional compilation directives.
The lexer recognizes C++26 keywords and additional integer literal suffixes.
The lexer recognizes module keywords.
The lexer supports single-line comments.
The lexer is updated for LilyPond 2.25.29.
The lexer supports C-style comments.
The lexer recognizes additional operators.
The lexer updates its recognized keywords.
The style supports more token types.
The lexer supports both schedules and deadlines.
The lexer recognizes the __PROPERTY__ magic constant and additional reserved keywords.
The lexer recognizes additional keywords.
The lexer supports t-strings.
The style supports more token types.
The lexer supports TOML 1.1.0.
Tooling 1
Updates the syntax file to Vim 9.2.
Fixes and other changes 64
Fixes colored keyword highlighting at the beginning of a name.
Adds missing Boogie and Civl Verifier keywords to highlighting.
Recognizes interpolated verbatim strings with either $@ or @$ prefixes.
Highlights a function following a namespace body.
Fixes lexer support for multiline pre-processor comments.
Recognizes union as a keyword.
Recognizes named, octal and Unicode character literals such as \space and \o377 as single tokens.
Adds a missing opcode parameter type letter.
Fixes single-quote backslash escaping.
Includes various lexer improvements.
Requires a word break after SET.
Avoids duplicating a character when wrapping a token that is not at the end of a line.
Matches only valid digits.
Improves handling of non-string types to fix broken clients.
Highlights the arguments object.
Recognizes colons in array slice expressions.
Allows apostrophes in element text.
Fixes backslash handling in rstrings.
Supports companion objects without an explicit name.
Prevents a nullable type marker from consuming the following character, so Foo?, and a?:b tokenize correctly.
Recognizes member-access dots in dynamic objects.
Invalid -L values no longer report success.
Honors the wrapped lexer's stripnl and other input options when escapeinside is set, so blank lines are no longer stripped under stripnl=false.
Includes various lexer improvements.
Updates recognized symbols to 1.26.05.
Highlights bold-italics written as ***...*** and ___...___.
Fixes wrong token offsets for embedded code blocks.
Supports hyphens in usernames matched by the mention regex.
Recognizes named-character escapes such as \[Nu] instead of emitting an Error token.
Allows ... line continuations in function definition signatures.
Requires a word break after SET.
Adds more keywords.
Recognizes sentinel.
Adds support for Python 3.15.
Recognizes frozendict.
Recognizes lazy imports.
Fixes a crash when error_color is set.
Stops duplicating the body of an unterminated heredoc.
Treats << after ), ] or } as the shift operator rather than the start of a heredoc.
Recognizes variable references in property values.
Fixes text blocks and adds missing syntax.
Keeps func a keyword in class func type methods.
Stops $name variable references at a dash.
Recognizes LaTeX math environments as math.
Treats module as a keyword only when followed by whitespace, so identifiers such as modules and module.exports are highlighted correctly.
Recognizes verbatim strings before ordinary quoted strings.
Includes small improvements to the VimScript lexer.
Recognizes sign-extension operators.
Marks SVG files as XML.
Recognizes non-breaking spaces as valid scalar content.
The lexer recognizes the minus sign and correctly handles the range operator.
autopygmentize has various improvements.
The lexer fixes analyse_text.
The Cython lexer has various improvements.
Architecture parsing is improved.
The Fennel lexer has various improvements.
The lexer handles escape sequences in character literals.
The kwargs dictionary is no longer mutated on each call.
The lexer is updated for Macaulay2 1.25.05 and 1.25.11.
The Mathematica lexer has various improvements.
Namespace tokenization is fixed.
The lexer no longer enters an infinite loop.
The lexer allows empty comment lines.
The color table is fixed.