git.iko.soy/typeable/pandoc
on master help sign in
OpenDocument writer: fixed dropped elements in some ordered lists.

Closes #2434.

commitce9d49ef0421f23fdc05fabd8d7f754d680bea47 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 3 Mar 2017, 22:48 (10 years ago) parentfb47d1d
2 files changed+60−1
src/Text/Pandoc/Writers/OpenDocument.hs+1−1 test/command/2434.md+59
src/Text/Pandoc/Writers/OpenDocument.hs+1−1
@@ -243,7 +243,7 @@ orderedListToOpenDocument o pn bs =
243243orderedItemToOpenDocument :: PandocMonad m
244244 => WriterOptions -> Int -> [Block] -> OD m Doc
245245orderedItemToOpenDocument o n (b:bs)
246− | OrderedList a l <- b = newLevel a l
246+ | OrderedList a l <- b = go =<< newLevel a l
247247 | Para l <- b = go =<< inParagraphTagsWithStyle ("P" ++ show n) <$> inlinesToOpenDocument o l
248248 | otherwise = go =<< blockToOpenDocument o b
249249 where
test/command/2434.mdnew file+59
@@ -0,0 +1,59 @@
1+```
2+% pandoc -t opendocument
3+1. a
4+2. b
5+ 1. alpha
6+ 2. beta
7+ * gamma
8+^D
9+<text:list text:style-name="L1">
10+ <text:list-item>
11+ <text:p text:style-name="P1">a</text:p>
12+ </text:list-item>
13+ <text:list-item>
14+ <text:p text:style-name="P1">b</text:p>
15+ <text:list>
16+ <text:list-item>
17+ <text:p text:style-name="P1">alpha</text:p>
18+ </text:list-item>
19+ <text:list-item>
20+ <text:p text:style-name="P1">beta</text:p>
21+ </text:list-item>
22+ </text:list>
23+ <text:list text:style-name="L2">
24+ <text:list-item>
25+ <text:p text:style-name="P2">gamma</text:p>
26+ </text:list-item>
27+ </text:list>
28+ </text:list-item>
29+</text:list>
30+```
31+
32+```
33+% pandoc -t opendocument
34+(@) text
35+
36+ some text
37+
38+ a) sub item 1
39+ b) sub item 2
40+
41+ more text -- this line is missing in the odt output
42+^D
43+<text:list text:style-name="L1">
44+ <text:list-item>
45+ <text:p text:style-name="P1">text</text:p>
46+ <text:p text:style-name="P1">some text</text:p>
47+ <text:list>
48+ <text:list-item>
49+ <text:p text:style-name="P1">sub item 1</text:p>
50+ </text:list-item>
51+ <text:list-item>
52+ <text:p text:style-name="P1">sub item 2</text:p>
53+ </text:list-item>
54+ </text:list>
55+ <text:p text:style-name="P1">more text – this line is missing in the
56+ odt output</text:p>
57+ </text:list-item>
58+</text:list>
59+```