Last modified: 2009-06-01 16:39:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T21017, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 19017 - TOC level calculation error in an odd case
TOC level calculation error in an odd case
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.16.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-31 00:27 UTC by Brad Jorsch
Modified: 2009-06-01 16:39 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Minimal patch against r51213 to fix the bug (380 bytes, patch)
2009-05-31 00:27 UTC, Brad Jorsch
Details
Patch against r51213 to fix the bug and remove the obsolete conditional (1.27 KB, patch)
2009-05-31 00:29 UTC, Brad Jorsch
Details

Description Brad Jorsch 2009-05-31 00:27:46 UTC
Created attachment 6172 [details]
Minimal patch against r51213 to fix the bug

The code that lays out the TOC corrects non-continuous sequences, for example a level-2 heading followed by a level-4. In looking over that code to answer a question as to how exactly that works, I found a bug in an odd case.

This wikitext:
 === A ===
 ==== B ====
 ===== C =====
 == D ==

Generates this TOC layout:
 1 A
   1.1 B
       1.1.1 C
       1.1.2 D

By any logic, it should do this instead:
 1 A
   1.1 B
       1.1.1 C
 2 D

The attached patch fixes this. This probably makes the special case for $toclevel == 2 && $level <= $levelCount[1] obsolete too, I'll attach that patch momentarily.
Comment 1 Brad Jorsch 2009-05-31 00:29:25 UTC
Created attachment 6173 [details]
Patch against r51213 to fix the bug and remove the obsolete conditional
Comment 2 Siebrand Mazeland 2009-06-01 16:39:34 UTC
Applied in r51292. Thanks.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links