git.iko.soy/typeable/pandoc
on master help sign in
Fixed spacing problems in textile nested lists.
commitcae3f8edbaac60e16152c87b93f0da317c1952f9 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 27 Nov 2010, 10:44 (16 years ago) parentd073b16
2 files changed+4−8
src/Text/Pandoc/Writers/Textile.hs+4−2 tests/writer.textile−6
src/Text/Pandoc/Writers/Textile.hs+4−2
@@ -176,9 +176,10 @@ blockToTextile opts x@(BulletList items) = do
176176 return $ " <ul>\n" ++ vcat contents ++ " </ul>\n"
177177 else do
178178 modify $ \s -> s { stListLevel = stListLevel s ++ "*" }
179+ level <- get >>= return . length . stListLevel
179180 contents <- mapM (listItemToTextile opts) items
180181 modify $ \s -> s { stListLevel = init (stListLevel s) }
181− return $ vcat contents ++ "\n"
182+ return $ vcat contents ++ (if level > 1 then "" else "\n")
182183
183184blockToTextile opts x@(OrderedList attribs items) = do
184185 oldUseTags <- liftM stUseTags get
@@ -190,9 +191,10 @@ blockToTextile opts x@(OrderedList attribs items) = do
190191 " </ol>\n"
191192 else do
192193 modify $ \s -> s { stListLevel = stListLevel s ++ "#" }
194+ level <- get >>= return . length . stListLevel
193195 contents <- mapM (listItemToTextile opts) items
194196 modify $ \s -> s { stListLevel = init (stListLevel s) }
195− return $ vcat contents ++ "\n"
197+ return $ vcat contents ++ (if level > 1 then "" else "\n")
196198
197199blockToTextile opts (DefinitionList items) = do
198200 contents <- withUseTags $ mapM (definitionListItemToTextile opts) items
tests/writer.textile−6
@@ -172,8 +172,6 @@ h2. Nested
172172** Tab
173173*** Tab
174174
175−
176−
177175Here's another:
178176
179177# First
@@ -181,7 +179,6 @@ Here's another:
181179#* Fee
182180#* Fie
183181#* Foe
184−
185182# Third
186183
187184Same thing but with paragraphs:
@@ -191,7 +188,6 @@ Same thing but with paragraphs:
191188#* Fee
192189#* Fie
193190#* Foe
194−
195191# Third
196192
197193h2. Tabs and spaces
@@ -201,7 +197,6 @@ h2. Tabs and spaces
201197** this is an example list item indented with tabs
202198** this is an example list item indented with spaces
203199
204−
205200h2. Fancy list markers
206201
207202 <ol start="2" style="list-style-type: decimal;">
@@ -237,7 +232,6 @@ Autonumbering:
237232# More.
238233## Nested.
239234
240−
241235Should not be a list item:
242236
243237M.A. 2007