@@ -277,8 +277,9 @@ template :: MWParser String
277template = try $ do
277template = try $ do
278 string "{{"
278 string "{{"
279 notFollowedBy (char '{')
279 notFollowedBy (char '{')
280+ let chunk = template <|> variable <|> many1 (noneOf "{}") <|> count 1 anyChar
280− contents <- manyTill anyChar (try $ string "}}")
281+ contents <- manyTill chunk (try $ string "}}")
281− return $ "{{" ++ contents ++ "}}"
282+ return $ "{{" ++ concat contents ++ "}}"
283blockTag :: MWParser Blocks
284blockTag :: MWParser Blocks
284blockTag = do
285blockTag = do
@@ -438,19 +439,18 @@ inline = whitespace
438 <|> inlineTag
439 <|> inlineTag
439 <|> B.singleton <$> charRef
440 <|> B.singleton <$> charRef
440 <|> inlineHtml
441 <|> inlineHtml
441− <|> variable
442+ <|> (B.rawInline "mediawiki" <$> variable)
442 <|> (B.rawInline "mediawiki" <$> template)
443 <|> (B.rawInline "mediawiki" <$> template)
443 <|> special
444 <|> special
445str :: MWParser Inlines
446str :: MWParser Inlines
446str = B.str <$> many1 (noneOf $ specialChars ++ spaceChars)
447str = B.str <$> many1 (noneOf $ specialChars ++ spaceChars)
448−variable :: MWParser Inlines
449+variable :: MWParser String
449−variable = B.rawInline "mediawiki" <$> triplebrackets
450+variable = try $ do
450− where triplebrackets = try $ do
451− string "{{{"
451+ string "{{{"
452− contents <- manyTill anyChar (try $ string "}}}")
452+ contents <- manyTill anyChar (try $ string "}}}")
453− return $ "{{{" ++ contents ++ "}}}"
453+ return $ "{{{" ++ contents ++ "}}}"
455inlineTag :: MWParser Inlines
455inlineTag :: MWParser Inlines
456inlineTag = do
456inlineTag = do
@@ -489,6 +489,7 @@ endline = () <$ try (newline <*
489 notFollowedBy blankline <*
489 notFollowedBy blankline <*
490 notFollowedBy' hrule <*
490 notFollowedBy' hrule <*
491 notFollowedBy tableStart <*
491 notFollowedBy tableStart <*
492+ notFollowedBy' header <*
492 notFollowedBy' template <*
493 notFollowedBy' template <*
493 notFollowedBy' (htmlTag isBlockTag') <*
494 notFollowedBy' (htmlTag isBlockTag') <*
494 notFollowedBy anyListStart)
495 notFollowedBy anyListStart)