aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-27 18:52:39 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-27 18:52:39 +0000
commit27d3657eefaf5dfe4a5d7f699d3e8c8d1457ab5c (patch)
treee452e46671babf8404f489805d08060903652eda
parent7a32ad72e37c073904dc754dd4d72a50b2fb9171 (diff)
downloadpandoc-27d3657eefaf5dfe4a5d7f699d3e8c8d1457ab5c.tar.gz
Fixed bug in markdown writer: If an ordered list item began with
a marker greater than 3 characters in width, and the item took more than one line, it would appear on the line after the list marker, e.g.: (12) My list item. Multiline. Now it works as follows: (12) My list item. Multiline. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1036 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 275156e52..4cecaae5d 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -250,7 +250,11 @@ orderedListItemToMarkdown :: WriterOptions -- ^ options
-> State WriterState Doc
orderedListItemToMarkdown opts marker items = do
contents <- blockListToMarkdown opts items
- return $ hang (text marker) (writerTabStop opts) contents
+ -- The complexities here are needed to ensure that if the list
+ -- marker is 4 characters or longer, the second and following
+ -- lines are indented 4 spaces but the list item begins after the marker.
+ return $ sep [nest (min (3 - length marker) 0) (text marker),
+ nest (writerTabStop opts) contents]
-- | Convert definition list item (label, list of blocks) to markdown.
definitionListItemToMarkdown :: WriterOptions