Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Prevent jumping to next section when target section is empty #291
Multiple reports have been made to WT:TW regarding protection requests being posted in the wrong section. The common thread between all reported cases is that the target section was empty at the time.
According to testing I did on a copy of the RFPP page in Notepad++, the problem was that the regex was consuming both the target section and the following section when the target section was empty. I'm honestly not sure how this fixes the problem, but Notepad++ testing says that it does. I'll just call it black magic and not argue with it. :P
Given the complexity of the regex, have you considered a more verbose definition? JS doesn't technically support verbose regexes, but it can be faked with string concatenation and normal comments. That might be worth considering here, so you can more precisely document exactly what each token is intended to match.