aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-02-09 08:17:53 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-02-09 08:17:53 -0800
commitb8eeb0f4daeecdbed8ec077defd5114e731da06c (patch)
treeac5b829cb4135fc4d3637cd97f2968db6420f5b3 /src/Text/Pandoc/Writers
parent47537d26db29b9dd0810d039933497d4db4ed813 (diff)
downloadpandoc-b8eeb0f4daeecdbed8ec077defd5114e731da06c.tar.gz
AsciiDoc writer: change bulletListLevel and orderedListLevel...
so that 0 means "not in a list," which is more what one would expect.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index 6fc000c4c..7b417af47 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -68,8 +68,8 @@ writeAsciiDoc :: PandocMonad m => WriterOptions -> Pandoc -> m Text
writeAsciiDoc opts document =
evalStateT (pandocToAsciiDoc opts document) WriterState{
defListMarker = "::"
- , orderedListLevel = 1
- , bulletListLevel = 1
+ , orderedListLevel = 0
+ , bulletListLevel = 0
, intraword = False
, autoIds = Set.empty
}
@@ -285,7 +285,7 @@ bulletListItemToAsciiDoc opts blocks = do
modify $ \s -> s{ bulletListLevel = lev + 1 }
contents <- foldM (addBlock opts) empty blocks
modify $ \s -> s{ bulletListLevel = lev }
- let marker = text (replicate lev '*')
+ let marker = text (replicate (lev + 1) '*')
return $ marker <> text " " <> contents <> cr
addBlock :: PandocMonad m => WriterOptions -> Doc -> Block -> ADW m Doc
@@ -307,7 +307,7 @@ orderedListItemToAsciiDoc opts blocks = do
modify $ \s -> s{ orderedListLevel = lev + 1 }
contents <- foldM (addBlock opts) empty blocks
modify $ \s -> s{ orderedListLevel = lev }
- let marker = text (replicate lev '.')
+ let marker = text (replicate (lev + 1) '.')
return $ marker <> text " " <> contents <> cr
-- | Convert definition list item (label, list of blocks) to asciidoc.