@@ -397,8 +397,9 @@ listItem c = try $ do
397397 then listItem' c
398398 else do
399399 skipMany spaceChar
400− first <- manyTill anyChar newline
401− rest <- many (try $ string extras *> manyTill anyChar newline)
400+ first <- concat <$> manyTill listChunk newline
401+ rest <- many
402+ (try $ string extras *> (concat <$> manyTill listChunk newline))
402403 contents <- parseFromString (many1 $ listItem' c)
403404 (unlines (first : rest))
404405 case c of
@@ -407,13 +408,23 @@ listItem c = try $ do
407408 ':' -> return $ B.definitionList [(mempty, contents)]
408409 _ -> mzero
409410
411+-- The point of this is to handle stuff like
412+-- * {{cite book
413+-- | blah
414+-- | blah
415+-- }}
416+-- * next list item
417+-- which seems to be valid mediawiki.
418+listChunk :: MWParser String
419+listChunk = template <|> count 1 anyChar
420+
410421listItem' :: Char -> MWParser Blocks
411422listItem' c = try $ do
412423 listStart c
413424 skipMany spaceChar
414− first <- manyTill anyChar newline
425+ first <- concat <$> manyTill listChunk newline
415426 rest <- many (try $ char c *> lookAhead listStartChar *>
416− manyTill anyChar newline)
427+ (concat <$> manyTill listChunk newline))
417428 parseFromString (firstParaToPlain . mconcat <$> many1 block)
418429 $ unlines $ first : rest
419430