git.iko.soy/typeable/pandoc
on master help sign in
AsciiDoc writer: change bulletListLevel and orderedListLevel...

so that 0 means "not in a list," which is more what one would expect.

commitb8eeb0f4daeecdbed8ec077defd5114e731da06c authorJohn MacFarlane <jgm@berkeley.edu> dateSat 9 Feb 2019, 08:17 (8 years ago) parent47537d2
1 file changed+4−4
src/Text/Pandoc/Writers/AsciiDoc.hs+4−4
src/Text/Pandoc/Writers/AsciiDoc.hs+4−4
@@ -68,8 +68,8 @@ writeAsciiDoc :: PandocMonad m => WriterOptions -> Pandoc -> m Text
6868writeAsciiDoc opts document =
6969 evalStateT (pandocToAsciiDoc opts document) WriterState{
7070 defListMarker = "::"
71− , orderedListLevel = 1
72− , bulletListLevel = 1
71+ , orderedListLevel = 0
72+ , bulletListLevel = 0
7373 , intraword = False
7474 , autoIds = Set.empty
7575 }
@@ -285,7 +285,7 @@ bulletListItemToAsciiDoc opts blocks = do
285285 modify $ \s -> s{ bulletListLevel = lev + 1 }
286286 contents <- foldM (addBlock opts) empty blocks
287287 modify $ \s -> s{ bulletListLevel = lev }
288− let marker = text (replicate lev '*')
288+ let marker = text (replicate (lev + 1) '*')
289289 return $ marker <> text " " <> contents <> cr
290290
291291addBlock :: PandocMonad m => WriterOptions -> Doc -> Block -> ADW m Doc
@@ -307,7 +307,7 @@ orderedListItemToAsciiDoc opts blocks = do
307307 modify $ \s -> s{ orderedListLevel = lev + 1 }
308308 contents <- foldM (addBlock opts) empty blocks
309309 modify $ \s -> s{ orderedListLevel = lev }
310− let marker = text (replicate lev '.')
310+ let marker = text (replicate (lev + 1) '.')
311311 return $ marker <> text " " <> contents <> cr
312312
313313-- | Convert definition list item (label, list of blocks) to asciidoc.