@@ -553,20 +553,22 @@ compactify' items =
553553 _ -> items
554554 _ -> items
555555
556−-- | Like @compactify'@, but akts on items of definition lists.
556+-- | Like @compactify'@, but acts on items of definition lists.
557557compactify'DL :: [(Inlines, [Blocks])] -> [(Inlines, [Blocks])]
558558compactify'DL items =
559559 let defs = concatMap snd items
560− defBlocks = reverse $ concatMap B.toList defs
561− in case defBlocks of
562− (Para x:_) -> if not $ any isPara (drop 1 defBlocks)
563− then let (t,ds) = last items
564− lastDef = B.toList $ last ds
565− ds' = init ds ++
566− [B.fromList $ init lastDef ++ [Plain x]]
567− in init items ++ [(t, ds')]
568− else items
569− _ -> items
560+ in case reverse (concatMap B.toList defs) of
561+ (Para x:xs)
562+ | not (any isPara xs) ->
563+ let (t,ds) = last items
564+ lastDef = B.toList $ last ds
565+ ds' = init ds ++
566+ if null lastDef
567+ then [B.fromList lastDef]
568+ else [B.fromList $ init lastDef ++ [Plain x]]
569+ in init items ++ [(t, ds')]
570+ | otherwise -> items
571+ _ -> items
570572
571573isPara :: Block -> Bool
572574isPara (Para _) = True