MediaWiki reader: Tightened up template parsing.
The opening "{{" must be followed by an alphanumeric or ':'. This prevents the exponential slowdown in #1033. Closes #1033.
This commit is contained in:
parent
8f20ac3da3
commit
d397a66107
1 changed files with 1 additions and 0 deletions
|
@ -317,6 +317,7 @@ template :: MWParser String
|
|||
template = try $ do
|
||||
string "{{"
|
||||
notFollowedBy (char '{')
|
||||
lookAhead $ letter <|> digit <|> char ':'
|
||||
let chunk = template <|> variable <|> many1 (noneOf "{}") <|> count 1 anyChar
|
||||
contents <- manyTill chunk (try $ string "}}")
|
||||
return $ "{{" ++ concat contents ++ "}}"
|
||||
|
|
Loading…
Add table
Reference in a new issue