Skip to content

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

@cderv

Description

@cderv

Pandoc 3.8 introduced a new --syntax-highlighting option that replaces the deprecated --highlighting-style. The defaults file field also changed from highlight-style to syntax-highlighting.

While Quarto's current highlight-style field still works (Pandoc accepts it for backwards compatibility), we should migrate to align with Pandoc's direction.

Proposed Changes

  1. Rename constant kHighlightStyle to kSyntaxHighlighting
  2. Change value from "highlight-style" to "syntax-highlighting"
  3. Update all usages across the codebase
  4. Remove null from the type definition (use "none" string instead)

Files Affected

  • src/config/constants.ts
  • src/config/types.ts
  • src/command/render/pandoc.ts
  • src/quarto-core/text-highlighting.ts
  • src/preview/preview-text.ts

Benefits

  • Aligns with Pandoc 3.8+ direction
  • Avoids deprecation warnings
  • Cleaner code (no null handling)

Follow-up

Documentation update needed for quarto-web syntax highlighting docs (docs/output-formats/_document-options-syntax-highlighting.md) to note Pandoc 3.8 accepts: none, default, idiomatic, style name, or path.

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions