Fix TOC anchor name collisions in edge cases
authorJackmcbarn <jackmcbarn@gmail.com>
Sun, 28 Dec 2014 20:07:49 +0000 (15:07 -0500)
committerAnomie <bjorsch@wikimedia.org>
Tue, 17 Feb 2015 20:59:33 +0000 (20:59 +0000)
commitcab99af90e4b5c9cc1d5f3ce769245876ac643a0
tree405db05702ef5291db16a06d3416f5f55eb2402d
parent1f40716a40449214a30438686da065952c3778cb
Fix TOC anchor name collisions in edge cases

Currently, the parser adds a "_2" to the second of two identical headlines to
avoid collisions, but there's still a collision if another headline actually
ends in "_2". This change causes the new headline to also be checked for a
collision, and advances to "_3" or beyond if there is one.

Bug: T26787
Change-Id: Id0a55aa4c1917bac2f8f0d4863fcb85bd3dff1ca
includes/parser/Parser.php
tests/parser/parserTests.txt