aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-09-08 21:47:25 -0700
committerJohn MacFarlane <[email protected]>2024-09-08 21:47:25 -0700
commitace048515fc57b16f7320ec8a8d546b2954e6c47 (patch)
tree21d7eadd6550d01c2154a8b0a6a69d76d1da2065
parent7602e4995f5769b141b896c732c381ae7ff0796c (diff)
OpenDocument writer: Removed another use of 'head'.
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
index 8238bf288..85df9c701 100644
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -305,7 +305,10 @@ orderedItemToOpenDocument o n bs = vcat <$> mapM go bs
go b = blockToOpenDocument o b
newLevel a l = do
nn <- length <$> gets stParaStyles
- ls <- head <$> gets stListStyles
+ liststyles <- gets stListStyles
+ let ls = case liststyles of
+ [] -> (1,[]) -- should never happen
+ (s:_) -> s
modify $ \s -> s { stListStyles = orderedListLevelStyle a ls :
drop 1 (stListStyles s) }
inTagsIndented "text:list" <$> orderedListToOpenDocument o nn l