Steps to replicate the issue (include links if applicable):
- Make an action=parse prop=sections API request with three headers and no NOTOC (execute)
- sections returns a proper array
- Add a NOTOC anywhere in the text (execute)
- sections returns a blank array
What happens?:
sections returns a blank array.
What should have happened instead?:
sections should be an array with section data.
Other information (browser name/version, screenshots, etc.):
This is currently causing issues with Ultraviolet, and AIV reports were no longer sending on February 23, the Thursday after [ 544a479 ] Parser: don't set TOCData if __NOTOC__ is used on the page got merged into mediawiki/core. I haven't checked if the MediaWiki version deployed on that day includes this commit explicitly.
The issue was only made evident to me today when debugging (with the assistance of User:Roundish) after finding out that UV fell into a should-never-happen case absolutely no sections were being returned. The related lines can be found here and they both depend on the sections returned by the parser. I'll be placing _another_ safeguard against this on Ultraviolet, but this is evidently a bug as there were no API deprecation warnings that went out that would have indicated that this behavior was planned.