git.iko.soy/typeable/pandoc
on master help sign in
MediaWiki reader: Allow def list item with just a term.
commitbc29f44d5970d87a7ed28d4008debae3e2cb724c authorJohn MacFarlane <jgm@berkeley.edu> dateSat 15 Sep 2012, 16:24 (14 years ago) parentc9faa27
1 file changed+4−1
src/Text/Pandoc/Readers/MediaWiki.hs+4−1
src/Text/Pandoc/Readers/MediaWiki.hs+4−1
@@ -367,7 +367,10 @@ definitionList = B.definitionList <$> many1 defListItem
367367defListItem :: MWParser (Inlines, [Blocks])
368368defListItem = try $ do
369369 terms <- mconcat . intersperse B.linebreak <$> many defListTerm
370− defs <- many1 $ listItem ':'
370+ -- we allow dd with no dt, or dt with no dd
371+ defs <- if B.isNull terms
372+ then many1 $ listItem ':'
373+ else many $ listItem ':'
371374 return (terms, defs)
372375
373376defListTerm :: MWParser Inlines