From 5934c8bb48e111e564530fa83955023173117047 Mon Sep 17 00:00:00 2001 From: Evan Silberman Date: Sun, 3 Nov 2024 14:49:03 -0800 Subject: [PATCH] Handle Bl -diag lists --- src/Text/Pandoc/Readers/Mdoc.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/Readers/Mdoc.hs b/src/Text/Pandoc/Readers/Mdoc.hs index 0ca712e13858..3acd2e31ea19 100644 --- a/src/Text/Pandoc/Readers/Mdoc.hs +++ b/src/Text/Pandoc/Readers/Mdoc.hs @@ -1010,18 +1010,20 @@ parseItemList = do parseDefinitionList :: PandocMonad m => MdocParser m Blocks parseDefinitionList = do - choice $ map literal ["-hang", "-inset", "-ohang", "-tag"] + headParser <- (choice . map literal) ["-hang", "-inset", "-ohang", "-tag"] $> parsedHead <|> literal "-diag" $> diagHead many skipListArgument eol - items <- many (parseSmToggle *> mempty <|> dlItem) + items <- many (parseSmToggle *> mempty <|> dlItem headParser) return $ B.definitionList items where - dlItem = do + parsedHead = try xoListHead <|> parseInline + diagHead = argsToInlines + dlItem hed = do -- Some manuals have an evidently useless .Pp before .It -- e.g. OpenBSD ld(1) optional (emptyMacro "Pp") macro "It" - dt <- (try xoListHead) <|> parseInline + dt <- hed dd <- mconcat <$> many parseRegularBlock return (dt, [dd]) xoListHead = do