From ce9d49ef0421f23fdc05fabd8d7f754d680bea47 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Mar 2017 22:48:37 +0100 Subject: OpenDocument writer: fixed dropped elements in some ordered lists. Closes #2434. --- src/Text/Pandoc/Writers/OpenDocument.hs | 2 +- test/command/2434.md | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 test/command/2434.md diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 8d9023951..c268c5133 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -243,7 +243,7 @@ orderedListToOpenDocument o pn bs = orderedItemToOpenDocument :: PandocMonad m => WriterOptions -> Int -> [Block] -> OD m Doc orderedItemToOpenDocument o n (b:bs) - | OrderedList a l <- b = newLevel a l + | OrderedList a l <- b = go =<< newLevel a l | Para l <- b = go =<< inParagraphTagsWithStyle ("P" ++ show n) <$> inlinesToOpenDocument o l | otherwise = go =<< blockToOpenDocument o b where diff --git a/test/command/2434.md b/test/command/2434.md new file mode 100644 index 000000000..aa03e5fc3 --- /dev/null +++ b/test/command/2434.md @@ -0,0 +1,59 @@ +``` +% pandoc -t opendocument +1. a +2. b + 1. alpha + 2. beta + * gamma +^D + + + a + + + b + + + alpha + + + beta + + + + + gamma + + + + +``` + +``` +% pandoc -t opendocument +(@) text + + some text + + a) sub item 1 + b) sub item 2 + + more text -- this line is missing in the odt output +^D + + + text + some text + + + sub item 1 + + + sub item 2 + + + more text – this line is missing in the + odt output + + +``` -- cgit v1.2.3