aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-11-27 10:44:35 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-11-27 10:44:35 -0800
commitcae3f8edbaac60e16152c87b93f0da317c1952f9 (patch)
tree9744506f996da296caf0c97e630222f24635a488 /src/Text
parentd073b168924a8391c771ecf47af3448bdfa027c6 (diff)
downloadpandoc-cae3f8edbaac60e16152c87b93f0da317c1952f9.tar.gz
Fixed spacing problems in textile nested lists.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Textile.hs6
1 files changed, 4 insertions, 2 deletions
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 $ " <ul>\n" ++ vcat contents ++ " </ul>\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
" </ol>\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