Improve parser handling of nested braces
per
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blobdiff;f=includes/parser/Preprocessor_DOM.php;h=468802d4ca3843ded13a8980ee633ca1a709909d;hp=250552838af7dd2230aa1815ff10920d5b8e6856;hb=9846e2558cb598b6dedcc32582d1139f9f9f1158;hpb=0888ccb0c30ac38e0f20516108ea18cd0269f1e1