aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-04-06 12:45:23 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-04-06 12:45:23 +0200
commit6b0d3d1582bd764a8496b4074608da11ae9349d4 (patch)
tree4fcc4ce7b58315ef8ce58ca7655e34b79cd2433e /src/Text/Pandoc/Writers
parent12ae1df5bfa447f94d8a3db24dd890e54bcbcf55 (diff)
downloadpandoc-6b0d3d1582bd764a8496b4074608da11ae9349d4.tar.gz
Ms writer: wider indents for lists.
Previously some indents weren't wide enough, leading the list item to start on a line after the marker.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Ms.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
index f162c4213..e4daa1be0 100644
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -347,7 +347,7 @@ blockToMs opts (BulletList items) = do
return (vcat contents)
blockToMs opts (OrderedList attribs items) = do
let markers = take (length items) $ orderedListMarkers attribs
- let indent = 1 + (maximum $ map length markers)
+ let indent = 2 + (maximum $ map length markers)
contents <- mapM (\(num, item) -> orderedListItemToMs opts num indent item) $
zip markers items
setFirstPara
@@ -365,15 +365,15 @@ bulletListItemToMs opts ((Para first):rest) =
bulletListItemToMs opts ((Plain first):rest) = do
first' <- blockToMs opts (Plain first)
rest' <- blockListToMs opts rest
- let first'' = text ".IP \\[bu] 2" $$ first'
+ let first'' = text ".IP \\[bu] 3" $$ first'
let rest'' = if null rest
then empty
- else text ".RS 2" $$ rest' $$ text ".RE"
+ else text ".RS 3" $$ rest' $$ text ".RE"
return (first'' $$ rest'')
bulletListItemToMs opts (first:rest) = do
first' <- blockToMs opts first
rest' <- blockListToMs opts rest
- return $ text "\\[bu] .RS 2" $$ first' $$ rest' $$ text ".RE"
+ return $ text "\\[bu] .RS 3" $$ first' $$ rest' $$ text ".RE"
-- | Convert ordered list item (a list of blocks) to ms.
orderedListItemToMs :: PandocMonad m
@@ -392,7 +392,8 @@ orderedListItemToMs opts num indent (first:rest) = do
let first'' = text (".IP \"" ++ num' ++ "\" " ++ show indent) $$ first'
let rest'' = if null rest
then empty
- else text ".RS 4" $$ rest' $$ text ".RE"
+ else text ".RS " <> text (show indent) $$
+ rest' $$ text ".RE"
return $ first'' $$ rest''
-- | Convert definition list item (label, list of blocks) to ms.