aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/OpenDocument.hs2
-rw-r--r--test/command/2434.md59
2 files changed, 60 insertions, 1 deletions
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
+<text:list text:style-name="L1">
+ <text:list-item>
+ <text:p text:style-name="P1">a</text:p>
+ </text:list-item>
+ <text:list-item>
+ <text:p text:style-name="P1">b</text:p>
+ <text:list>
+ <text:list-item>
+ <text:p text:style-name="P1">alpha</text:p>
+ </text:list-item>
+ <text:list-item>
+ <text:p text:style-name="P1">beta</text:p>
+ </text:list-item>
+ </text:list>
+ <text:list text:style-name="L2">
+ <text:list-item>
+ <text:p text:style-name="P2">gamma</text:p>
+ </text:list-item>
+ </text:list>
+ </text:list-item>
+</text:list>
+```
+
+```
+% 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:list text:style-name="L1">
+ <text:list-item>
+ <text:p text:style-name="P1">text</text:p>
+ <text:p text:style-name="P1">some text</text:p>
+ <text:list>
+ <text:list-item>
+ <text:p text:style-name="P1">sub item 1</text:p>
+ </text:list-item>
+ <text:list-item>
+ <text:p text:style-name="P1">sub item 2</text:p>
+ </text:list-item>
+ </text:list>
+ <text:p text:style-name="P1">more text – this line is missing in the
+ odt output</text:p>
+ </text:list-item>
+</text:list>
+```