aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-19 23:01:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-19 23:01:02 -0700
commit13e443d7cc77aaf52712ebf2acbedb12090ef094 (patch)
tree564dd0a08864466c3a9d2421c4abdae155d6eb46 /src
parentc01897281a468797a021ac2b05a7520b93247711 (diff)
downloadpandoc-13e443d7cc77aaf52712ebf2acbedb12090ef094.tar.gz
Man writer: avoid unnecessary `.RS`/`.RE` pair in defn lists.
When the definition is just one paragraph, we don't need the `.RS\n.RE`.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Man.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
index d2803f06f..645476b77 100644
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -253,7 +253,9 @@ definitionListItemToMan opts (label, defs) = do
rest' <- liftM vcat $ mapM
(\item -> blockToMan opts item) xs
return $ first' $$
- text ".RS" $$ rest' $$ text ".RE"
+ if null xs
+ then empty
+ else text ".RS" $$ rest' $$ text ".RE"
[] -> return empty
return $ text ".TP" $$ nowrap (text ".B " <> labelText) $$ contents