Page MenuHomePhabricator

Section edit link returns 'Cannot find section'
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • emits error, 'Cannot find section. You tried to edit a section that does not exist. Because there is no section 15, there is no place to save your edit.'

What should have happened instead?:

  • Edits the section.

Note: section Wikipedia:Village pump (idea lab)#Screwup in section editability is also the discussion section for this issue at WP:VPI, and has some ideas why this might be occurring, thanks to @Kusma.

This report inspired by Kusma's comment:

Seems to be a Parsoid issue, probably related to the boxed == in the section above: If you use https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(idea_lab)&useparsoid=0 then the edit section links go to the correct place. Clearly the parser and the editor should agree on the section numbers, so this is a bug.

Event Timeline

Subsequent edits by @Thryduulf while I was filing this seem to have resolved the immediate problem on that page, but the underlying problem remains.

The issue appears to have been caused by a {{box}} template with the parameter
== <span class="anchor" id="BEFORE"></span><span class="anchor" id="RFCBEFORE"></span>Before starting the process ==
Some testing at user:Thryduulf/sandbox shows that the issue is the combination of the span and the equals signs.

If you remove the equals signs, surround them with <nowiki> tags or use &equals; then the template doesn't work (it gives and unknown parameter warning on preview) but the following sections are editable. If the span is removed but the equals signs remain then everything works as it should.

The top version in @Thryduulf 's sandbox does not show the bug, so I made my own version: https://en.wikipedia.org/wiki/User:Kusma/sandbox/sebug

The edit section links all work as expected without Parsoid:
https://en.wikipedia.org/w/index.php?title=User:Kusma/sandbox/sebug&useparsoid=0

But note that when editing, the sections are numbered 1, 2, 4, 5, not 1, 2, 3, 4 as shown in the ToC.