Hack to edit the 1st section of the page when the 0th section is empty (see T51215 / rEMFR52c3e508c01a: Open first section in editor when lead section empty) doesn't work if the page has a TOC, because it is counted as a part of the 0th section.
Replication steps
- Go to https://reading-web-staging.wmflabs.org/wiki/User:Jdlrobson/no_lead?useformat=mobile#
- Click edit icon at top of page
- See an empty section.
Expected: Should I see a non-empty section?
Developer notes
A hack was previously added to avoid the situation where a page has no lead section and the top edit icon when clicked will show an empty section. Previously, clicking this edit icon would load the first section, on the basis that you can still edit the lead section by prefixing text above the heading.
For instance to edit
== Heading == Text
You can insert a lead paragraph like so:
Lead paragraph. == Heading == Text
I don't think this hack is helpful, give its a hack, especially given we know lead paragraphs are useful (and help projects such as page previews) and pages which also have no lead section are in the minority.
However, if we want to restore this behaviour, please let us know!
If not, we should remove the broken code.