diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-08-18 11:37:10 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-08-18 11:37:10 -0700 |
| commit | 748da6d1235ea94f11040c8b810659fdc8cd6b43 (patch) | |
| tree | 7eabc9065c0c6a11396185b4f419444da4021ab2 | |
| parent | ecdbd18bc1234bac2cb44a01694b6c23e33584a5 (diff) | |
Handle haddock 1.11.0 API changes (not noted in their changelog).
| -rw-r--r-- | src/Text/Pandoc/Readers/Haddock.hs | 10 |
1 files changed, 10 insertions, 0 deletions
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) |
