Handle raw <h#> when calculating $rawtoc
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 9 Oct 2013 15:03:40 +0000 (11:03 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 9 Oct 2013 17:48:03 +0000 (13:48 -0400)
commit12bc4f1c5b7cef7d9e7e96cea0957f4336fa2a66
tree56c359d618752115c196923d741883d51557b8d0
parent626addab9ed225790ed7054cbcff039412df1823
Handle raw <h#> when calculating $rawtoc

When the parser is constructing $rawtoc, it needs the sectionIndex
number to be able to calculate the byteoffset. This number is only
available for wikitext headings ("== foo =="), HTML headings
("<h2>foo</h2>") do not have it and the lack makes byteoffset be wrong
for all subsequent headings in the page.

To fix this, we just omit output of byteoffset in this situation.

Bug: 25203
Change-Id: I39e5faa4ac22d915f06125aac36ced11607b94a3
includes/parser/Parser.php
tests/phpunit/includes/parser/ParserMethodsTest.php