# What changed in pygments

> 109 changes in pygments 2 from its official release notes, upgrade guides and advisories: 3 breaking, 3 security, 13 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/pypi/pygments/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## pygments 2

### Breaking changes

- Renders double and single quotation marks literally. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Python 3.8 is no longer supported, and Python 3.14 is now supported. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The Coq lexer has been renamed to Rocq. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)

### Security

- Fixes catastrophic backtracking in looks_like_xml. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- GUID and ID patterns no longer cause catastrophic backtracking. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0), [security advisory](https://github.com/advisories/GHSA-5239-WWWM-4PMQ)
- The lexer no longer causes catastrophic backtracking. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)

### New APIs and options

- Adds a lexer for BitBake. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds a lexer for Caddyfile. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds a lexer for CEL. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds .ipp as a recognized C/C++ file extension. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds the Night Owl style. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds a lexer for PureScript. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Allows transparent as a color style definition. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds yml as an alias. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- The lexer supports overlay/fragments and bytestrings. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer recognizes the operators ]', ]?, and ]!. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- A Rell lexer is available for highlighting Rell code. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer recognizes commands introduced in versions 5.3 through 5.6. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The .xbrl file ending is recognized. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)

### Performance

- Entry points are cached to improve performance. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)

### Behavior and default changes

- Adds highlighting for C23/C++26 attributes. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds more C2Y keywords. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Supports dollar-prefixed and multi-quote raw strings. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Derives from the C++ lexer instead of C, highlighting C++ constructs such as template, class and namespace. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Allows non-ASCII Unicode identifiers. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Improves the monokai theme colors. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Allows . and + in directive and role names. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes chevron prompts. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Allows uppercase letters at the start of identifiers. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes conditional compilation directives. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- The lexer recognizes C++26 keywords and additional integer literal suffixes. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer recognizes module keywords. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer supports single-line comments. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer is updated for LilyPond 2.25.29. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer supports C-style comments. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer recognizes additional operators. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer updates its recognized keywords. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The style supports more token types. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer supports both schedules and deadlines. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer recognizes the __PROPERTY__ magic constant and additional reserved keywords. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer recognizes additional keywords. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer supports t-strings. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The style supports more token types. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer supports TOML 1.1.0. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)

### Tooling

- Updates the syntax file to Vim 9.2. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)

### Fixes and other changes

- Fixes colored keyword highlighting at the beginning of a name. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds missing Boogie and Civl Verifier keywords to highlighting. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes interpolated verbatim strings with either $@ or @$ prefixes. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Highlights a function following a namespace body. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Fixes lexer support for multiline pre-processor comments. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes union as a keyword. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes named, octal and Unicode character literals such as \space and \o377 as single tokens. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds a missing opcode parameter type letter. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Fixes single-quote backslash escaping. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Includes various lexer improvements. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Requires a word break after SET. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Avoids duplicating a character when wrapping a token that is not at the end of a line. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Matches only valid digits. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Improves handling of non-string types to fix broken clients. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Highlights the arguments object. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes colons in array slice expressions. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Allows apostrophes in element text. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Fixes backslash handling in rstrings. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Supports companion objects without an explicit name. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Prevents a nullable type marker from consuming the following character, so Foo?, and a?:b tokenize correctly. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes member-access dots in dynamic objects. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Invalid -L values no longer report success. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- 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.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Includes various lexer improvements. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Updates recognized symbols to 1.26.05. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Highlights bold-italics written as ***...*** and ___...___. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Fixes wrong token offsets for embedded code blocks. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Supports hyphens in usernames matched by the mention regex. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes named-character escapes such as \[Nu] instead of emitting an Error token. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Allows ... line continuations in function definition signatures. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Requires a word break after SET. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds more keywords. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes sentinel. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Adds support for Python 3.15. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes frozendict. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes lazy imports. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Fixes a crash when error_color is set. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Stops duplicating the body of an unterminated heredoc. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Treats << after ), ] or } as the shift operator rather than the start of a heredoc. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes variable references in property values. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Fixes text blocks and adds missing syntax. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Keeps func a keyword in class func type methods. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Stops $name variable references at a dash. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes LaTeX math environments as math. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Treats module as a keyword only when followed by whitespace, so identifiers such as modules and module.exports are highlighted correctly. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes verbatim strings before ordinary quoted strings. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Includes small improvements to the VimScript lexer. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes sign-extension operators. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Marks SVG files as XML. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- Recognizes non-breaking spaces as valid scalar content. (2.21.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.21.0)
- The lexer recognizes the minus sign and correctly handles the range operator. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- autopygmentize has various improvements. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer fixes analyse_text. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The Cython lexer has various improvements. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- Architecture parsing is improved. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The Fennel lexer has various improvements. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer handles escape sequences in character literals. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The kwargs dictionary is no longer mutated on each call. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer is updated for Macaulay2 1.25.05 and 1.25.11. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The Mathematica lexer has various improvements. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- Namespace tokenization is fixed. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer no longer enters an infinite loop. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The lexer allows empty comment lines. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
- The color table is fixed. (2.20.0) — [release notes](https://github.com/pygments/pygments/releases/tag/2.20.0)
