diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-02-09 08:17:53 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-02-09 08:17:53 -0800 |
commit | b8eeb0f4daeecdbed8ec077defd5114e731da06c (patch) | |
tree | ac5b829cb4135fc4d3637cd97f2968db6420f5b3 /src/Text | |
parent | 47537d26db29b9dd0810d039933497d4db4ed813 (diff) | |
download | pandoc-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')
-rw-r--r-- | src/Text/Pandoc/Writers/AsciiDoc.hs | 8 |
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. |