HomePhabricator

Fix wikitext template parser failing on unballanced brackets

Authored by thiemowmde on May 3 2019, 12:36 PM.

Description

Fix wikitext template parser failing on unballanced brackets

I found this while working on T198584. The mistake in this little parser
was that the second bracket in a {{ or }} pair was not skipped, and could
become the start of another pair. This is usually not a problem, but can
cause bad replacements in edge-cases, as demonstrated by the test cases.

I did not created a Phabricator ticket for this because I'm not aware
this ever caused actual problems in production (but potentially can).

Change-Id: I80ab97335838293f841122b4c8e4a973bf5342eb

Details