Skip to content

Commit 1edf415

Browse files
committed
pandoc 3.8+, highlight-style - Use "none" string instead of null
Pandoc 3.8 changed optSyntaxHighlighting from HighlightMethod type to Text. The old HighlightMethod FromJSON accepted null, but Text rejects it with: "Aeson exception: Error in $: parsing Text failed, expected String, but encountered Null" Pass "none" string instead of null when highlight-style: none is set.
1 parent 8bd7018 commit 1edf415

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/command/render/pandoc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,9 +1755,9 @@ function resolveTextHighlightStyle(
17551755
const textHighlightingMode = extras.html?.[kTextHighlightingMode];
17561756

17571757
if (highlightTheme === "none") {
1758-
// Clear the highlighting
1758+
// Disable highlighting - pass "none" string (not null, which Pandoc 3.8+ rejects)
17591759
extras.pandoc = extras.pandoc || {};
1760-
extras.pandoc[kHighlightStyle] = null;
1760+
extras.pandoc[kHighlightStyle] = "none";
17611761
return extras;
17621762
}
17631763

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: highlight-style none test
3+
format:
4+
html:
5+
highlight-style: none
6+
_quarto:
7+
tests:
8+
html:
9+
noErrors: default
10+
---
11+
12+
Test that `highlight-style: none` works with Pandoc 3.8+.
13+
14+
```python
15+
print("Hello, World!")
16+
```

0 commit comments

Comments
 (0)