Skip to content

fix: relabel a language only for a block with a title - #99

Merged
mcanouil merged 1 commit into
mainfrom
fix/relabel-named-blocks-only
Nov 23, 2026
Merged

mcanouil merged 1 commit into
mainfrom
fix/relabel-named-blocks-only

Conversation

@mcanouil

Copy link
Copy Markdown
Owner

A code block that gets no title now keeps the language class the author wrote.
This covers code-window-enabled="false", and code-window-no-auto-filename="true" on a block with no filename.

The pass that relabels a language Pandoc cannot highlight checked these per-block opt-outs only when auto-filename was off for the whole document.
With the default auto-filename: true, such a block lost its class to default even though no title would ever read the label.
The pass now skips these blocks in every document.
A block with a filename of its own still gets a title, so it is still relabelled.

The new language-refused fixture has both opt-outs, one block that gets a derived title, and one block with a filename.
The test checks that the first two keep foo and the last two get default foo.

@mcanouil mcanouil added the Type: Bug 🐛 Issues related to bugs, errors, or mistakes label Nov 22, 2026
@mcanouil mcanouil self-assigned this Nov 22, 2026
@mcanouil
mcanouil marked this pull request as ready for review November 22, 2026 22:19
The relabel pass checked the per-block opt-outs only when auto-filename was off, so a block that refused a title still lost its language class to default.
@mcanouil
mcanouil force-pushed the fix/relabel-named-blocks-only branch from d0a1845 to 7d50f02 Compare November 23, 2026 09:47
@mcanouil
mcanouil merged commit 3ecba04 into main Nov 23, 2026
1 check passed
@mcanouil
mcanouil deleted the fix/relabel-named-blocks-only branch November 23, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug 🐛 Issues related to bugs, errors, or mistakes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant