Page MenuHomePhabricator

Invalid heading markup made valid by template expansion, causes ghost section
Closed, ResolvedPublic

Description

Author: mohr.42

Description:
If you create a heading as such:

Section 1=={{template}}

and then have

Section 2

Clicking the "edit" link for "Section 1" brings up an editor for "Section 2",
not "Section 1".

I found this on an article and removed fixed the offending formatting, but
recreated it on my user page:

http://en.wikipedia.org/wiki/User:Mohrr


Version: unspecified
Severity: minor
URL: http://en.wikipedia.org/wiki/User:Mohrr

Details

Reference
bz9156

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:36 PM
bzimport set Reference to bz9156.
bzimport added a subscriber: Unknown Object (MLST).

ayg wrote:

Proposed patch

The problem is in Parser::extractSections, pretty much as expected: the regex
doesn't like non-whitespace on the same line as a wikitext header. Patch
probably fixes it, but I haven't tested it, since PHP broke when I tried to
install 5.2 locally and I haven't had time to fix it.

Attached:

ayg wrote:

*** Bug 9815 has been marked as a duplicate of this bug. ***

There is indeed not supposed to be anything else on the same line as a heading.
The bug is that some constructions end up internally stripping that data from
the line so it ends up getting incorrectly processed for display as though it
were valid input.

Changed bug title. Similar to bug 11911.