gitit icon indicating copy to clipboard operation
gitit copied to clipboard

Fix for `pandoc-3.8`

Open hololeap opened this issue 3 months ago • 1 comments

Currently, building gitit with pandoc-3.8 fails with:

[12 of 21] Compiling Network.Gitit.ContentTransformer ( src/Network/Gitit/ContentTransformer.hs, dist/build/Network/Gitit/ContentTransformer.o, dist/build/Network/Gitit/ContentTransformer.dyn_o )

src/Network/Gitit/ContentTransformer.hs:523:25: error: [GHC-22385]
    Not in scope: record field ‘writerHighlightStyle’
    Suggested fix:
      Perhaps use record field of WriterOptions ‘writerHighlightMethod’ (imported from Text.Pandoc)
    |
523 |                       , writerHighlightStyle = Just pygments
    |                         ^^^^^^^^^^^^^^^^^^^^

But, it is an easy fix.

hololeap avatar Oct 13 '25 23:10 hololeap

This won't work for multiple pandoc versions unless you use CPP conditions in the code, so that the old API will be used for older pandoc versions.

#if MIN_VERSION_pandoc(3,8,0)

#else 

#endif

jgm avatar Oct 14 '25 07:10 jgm