Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Feb 2, 2026

Pandoc 3.8 introduced --syntax-highlighting to replace --highlight-style.
This adds the new option to Quarto with support for:

  • Style names (tango, github, etc.) for Pandoc skylighting
  • Custom .theme files for KDE syntax themes
  • "none" to disable highlighting
  • "idiomatic" for native format highlighting (typst native, LaTeX listings)

The deprecated highlight-style option remains supported but is hidden
from autocomplete. Typst format now supports all syntax highlighting
options including syntax-definitions for custom language definitions.

Format Support for idiomatic

Format Status Notes
Typst Works Native typst highlighting with fenced code blocks
LaTeX/PDF Works Uses listings package instead of fancyvrb/Shaded
reveal.js Blocked Emits warning, falls back to skylighting (#13989)

reveal.js limitation

Pandoc's reveal.js writer doesn't properly produce highlight.js output when
idiomatic is used - it results in no highlighting at all. Quarto now detects
this and emits a warning while falling back to default skylighting.

See #13989 for tracking the reveal.js idiomatic support.

Tests

Smoke-all tests added for:

  • tests/docs/smoke-all/typst/syntax-highlighting/ (5 tests)
  • tests/docs/smoke-all/latex/syntax-highlighting/idiomatic.qmd
  • tests/docs/smoke-all/revealjs/syntax-highlighting/idiomatic-warning.qmd

Fixes #13878

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Feb 2, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

cderv and others added 8 commits February 3, 2026 16:31
Pandoc 3.8 introduced --syntax-highlighting to replace --highlight-style.
This adds the new option to Quarto with support for:
- Style names (tango, github, etc.) for Pandoc skylighting
- Custom .theme files for KDE syntax themes
- "none" to disable highlighting
- "idiomatic" for native format highlighting (typst, LaTeX listings, reveal.js)

The deprecated highlight-style option remains supported but is hidden
from autocomplete. Typst format now supports all syntax highlighting
options including syntax-definitions for custom language definitions.

Fixes #13878

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update to use --syntax-highlighting for Pandoc 3.8 compatibility.
Since 1edf415, highlight-style: none sets "none" string instead of null.
The ?? operator and null check didn't catch this, causing hasTextHighlighting
to incorrectly return true when highlighting was disabled.

- Use || fallback (consistent with hasAdaptiveTheme, readHighlightingTheme)
- Check for "none" string instead of null
- Remove unreachable null check (|| chain always provides default)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidate repeated theme resolution logic into a single exported function.
Three functions now use this helper instead of duplicating the fallback chain.

- Add getHighlightTheme() with syntax-highlighting > highlight-style > default
- Simplify readHighlightingTheme, hasAdaptiveTheme, hasTextHighlighting
- Add 4 unit tests for getHighlightTheme (18 total)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reveal.js doesn't properly support Pandoc's idiomatic highlighting mode,
resulting in no highlighting at all. Emit a warning and fall back to
default skylighting instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cderv cderv marked this pull request as ready for review February 3, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate highlight-style to syntax-highlighting for Pandoc 3.8 alignment

3 participants