From cae3f8edbaac60e16152c87b93f0da317c1952f9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 27 Nov 2010 10:44:35 -0800 Subject: Fixed spacing problems in textile nested lists. --- src/Text/Pandoc/Writers/Textile.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers/Textile.hs') diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs index 8dd2288c9..05acb5e8b 100644 --- a/src/Text/Pandoc/Writers/Textile.hs +++ b/src/Text/Pandoc/Writers/Textile.hs @@ -176,9 +176,10 @@ blockToTextile opts x@(BulletList items) = do return $ " \n" else do modify $ \s -> s { stListLevel = stListLevel s ++ "*" } + level <- get >>= return . length . stListLevel contents <- mapM (listItemToTextile opts) items modify $ \s -> s { stListLevel = init (stListLevel s) } - return $ vcat contents ++ "\n" + return $ vcat contents ++ (if level > 1 then "" else "\n") blockToTextile opts x@(OrderedList attribs items) = do oldUseTags <- liftM stUseTags get @@ -190,9 +191,10 @@ blockToTextile opts x@(OrderedList attribs items) = do " \n" else do modify $ \s -> s { stListLevel = stListLevel s ++ "#" } + level <- get >>= return . length . stListLevel contents <- mapM (listItemToTextile opts) items modify $ \s -> s { stListLevel = init (stListLevel s) } - return $ vcat contents ++ "\n" + return $ vcat contents ++ (if level > 1 then "" else "\n") blockToTextile opts (DefinitionList items) = do contents <- withUseTags $ mapM (definitionListItemToTextile opts) items -- cgit v1.2.3