From fcd8eae9400be99a3bdcf62bcaf1d5cd7df90559 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 22 Mar 2026 15:41:37 +0100 Subject: [PATCH] Man writer: don't run together successive definitions... in a tight definition list with multiple definitions after a term. Closes #11547. --- src/Text/Pandoc/Writers/Man.hs | 2 +- test/writer.man | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 49ff84bc9..322fd9423 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -241,7 +241,7 @@ definitionListItemToMan opts (label, defs) = do labelText <- inlineListToMan opts label contents <- if null defs then return empty - else liftM vcat $ forM defs $ \case + else case mconcat defs of (x:xs) -> do first' <- blockToMan opts $ case x of diff --git a/test/writer.man b/test/writer.man index aa908224f..4bd5efe54 100644 --- a/test/writer.man +++ b/test/writer.man @@ -359,27 +359,40 @@ Multiple definitions, tight: .TP apple red fruit +.RS computer +.RE .TP orange orange fruit +.RS bank +.RE .PP Multiple definitions, loose: .TP apple red fruit +.RS +.PP computer +.RE .TP orange orange fruit +.RS +.PP bank +.RE .PP Blank line after term, indented marker, alternate markers: .TP apple red fruit +.RS +.PP computer +.RE .TP orange orange fruit