From 13e443d7cc77aaf52712ebf2acbedb12090ef094 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 19 Oct 2018 23:01:02 -0700 Subject: 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`. --- src/Text/Pandoc/Writers/Man.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3