Skip to content

Commit

Permalink
Handle Bl -diag lists
Browse files Browse the repository at this point in the history
  • Loading branch information
silby committed Nov 3, 2024
1 parent 803ba37 commit 5934c8b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Text/Pandoc/Readers/Mdoc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5934c8b

Please sign in to comment.