git.iko.soy/typeable/pandoc
on master help sign in
Docx reader: Single-item headers in ordered lists are headers.
7fe5450Jesse Rosenthal
src/Text/Pandoc/Readers/Docx/Lists.hs+6−4
@@ -160,8 +160,14 @@ flatToBullets' num xs@(b : elems)
160flatToBullets :: [Block] -> [Block]
160flatToBullets :: [Block] -> [Block]
161flatToBullets elems = flatToBullets' (-1) elems
161flatToBullets elems = flatToBullets' (-1) elems
162
162
163+singleItemHeaderToHeader :: Block -> Block
164+singleItemHeaderToHeader (OrderedList _ [[h@(Header _ _ _)]]) = h
165+singleItemHeaderToHeader blk = blk
166+
167+
163blocksToBullets :: [Block] -> [Block]
168blocksToBullets :: [Block] -> [Block]
164blocksToBullets blks =
169blocksToBullets blks =
170+ map singleItemHeaderToHeader $
165 bottomUp removeListDivs $
171 bottomUp removeListDivs $
166 flatToBullets $ (handleListParagraphs blks)
172 flatToBullets $ (handleListParagraphs blks)
167
173
@@ -221,7 +227,3 @@ removeListDivs = concatMap removeListDivs'
221
227
222blocksToDefinitions :: [Block] -> [Block]
228blocksToDefinitions :: [Block] -> [Block]
223blocksToDefinitions = blocksToDefinitions' [] []
229blocksToDefinitions = blocksToDefinitions' [] []
224−
225−
226−
227−