Page MenuHomePhabricator

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


Author: mohr.42

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:

Version: unspecified
Severity: minor



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.


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.