git.iko.soy/typeable/pandoc
on master help sign in
Fixed bugs in OpenDocument writer affecting nested block quotes.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1304 788f1e2b-df1e-0410-8736-df70ead52e1b

commit6bbe5d435de76ea32cefa7b42e63bef26d1be9f3 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 13 Jul 2008, 16:31 (18 years ago) parent7447ecc
1 file changed+6−7
Text/Pandoc/Writers/OpenDocument.hs+6−7
Text/Pandoc/Writers/OpenDocument.hs+6−7
@@ -1,4 +1,3 @@
1−{-# OPTIONS_GHC -Wall #-}
21{-# LANGUAGE PatternGuards #-}
32{-
43Copyright (C) 2008 Andrea Rossato <andrea.rossato@ing.unitn.it>
@@ -85,7 +84,7 @@ increaseIndent :: State WriterState ()
8584increaseIndent = modify $ \s -> s { stIndentPara = 1 + stIndentPara s }
8685
8786resetIndent :: State WriterState ()
88−resetIndent = modify $ \s -> s { stIndentPara = 0 }
87+resetIndent = modify $ \s -> s { stIndentPara = (stIndentPara s) - 1 }
8988
9089setInDefinitionList :: Bool -> State WriterState ()
9190setInDefinitionList b = modify $ \s -> s { stInDefinition = b }
@@ -224,11 +223,11 @@ inBlockQuote :: WriterOptions -> Int -> [Block] -> State WriterState Doc
224223inBlockQuote o i (b:bs)
225224 | BlockQuote l <- b = do increaseIndent
226225 ni <- paraStyle "Quotations" []
227− go ni =<< inBlockQuote o ni l
228− | Para l <- b = do go i =<< inParagraphTagsWithStyle ("P" ++ show i) <$> inlinesToOpenDocument o l
229− | otherwise = do go i =<< blockToOpenDocument o b
230− where go ni block = ($$) block <$> inBlockQuote o ni bs
231−inBlockQuote _ _ [] = resetIndent >> return empty
226+ go =<< inBlockQuote o ni (map plainToPara l)
227+ | Para l <- b = do go =<< inParagraphTagsWithStyle ("P" ++ show i) <$> inlinesToOpenDocument o l
228+ | otherwise = do go =<< blockToOpenDocument o b
229+ where go block = ($$) block <$> inBlockQuote o i bs
230+inBlockQuote _ _ [] = resetIndent >> return empty
232231
233232-- | Convert a list of Pandoc blocks to OpenDocument.
234233blocksToOpenDocument :: WriterOptions -> [Block] -> State WriterState Doc