From 748da6d1235ea94f11040c8b810659fdc8cd6b43 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 Aug 2022 11:37:10 -0700 Subject: [PATCH] Handle haddock 1.11.0 API changes (not noted in their changelog). --- src/Text/Pandoc/Readers/Haddock.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs index 67b3af2d3..2c2df4757 100644 --- a/src/Text/Pandoc/Readers/Haddock.hs +++ b/src/Text/Pandoc/Readers/Haddock.hs @@ -72,7 +72,17 @@ docHToBlocks d' = DocHeader h -> B.header (headerLevel h) (docHToInlines False $ headerTitle h) DocUnorderedList items -> B.bulletList (map docHToBlocks items) +#if MIN_VERSION_haddock_library(1,11,0) + DocOrderedList items -> + B.orderedListWith attr (map (docHToBlocks . snd) items) + where + attr = (start, DefaultStyle, DefaultDelim) + start = case items of + [] -> 1 + ((n,_):_) -> n +#else DocOrderedList items -> B.orderedList (map docHToBlocks items) +#endif DocDefList items -> B.definitionList (map (\(d,t) -> (docHToInlines False d, [consolidatePlains $ docHToBlocks t])) items)