Skip to content

Commit 7bf5b29

Browse files
authored
Pygments needs a non-None value for code block title (#2863)
* Pygments needs a non-None value for code block title * Typo
1 parent 20b11eb commit 7bf5b29

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

docs/src/markdown/about/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ icon: lucide/scroll-text
33
---
44
# Changelog
55

6+
## 10.21.1
7+
8+
- **FIX**: Highlight: Latest Pygments versions cannot handle a "filename" for code block titles of `None`.
9+
610
## 10.21
711

812
- **NEW**: Caption: Add support for specifying not only IDs but classes and arbitrary attributes. Initial work by

pymdownx/__meta__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,5 @@ def parse_version(ver: str) -> Version:
193193
return Version(major, minor, micro, release, pre, post, dev)
194194

195195

196-
__version_info__ = Version(10, 21, 0, "final")
196+
__version_info__ = Version(10, 21, 1, "final")
197197
__version__ = __version_info__._get_canonical()

pymdownx/highlight.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ def highlight(
394394
title = self.auto_title_map.get(name, name)
395395
if title:
396396
title = title.strip()
397+
if title is None:
398+
title = ''
397399

398400
# Setup formatter
399401
html_formatter = InlineHtmlFormatter if inline else BlockHtmlFormatter

0 commit comments

Comments
 (0)