https://bugzilla.wikimedia.org/show_bug.cgi?id=19017

           Summary: TOC level calculation error in an odd case
           Product: MediaWiki
           Version: 1.16-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch
          Severity: enhancement
          Priority: Normal
         Component: Page rendering
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=6172)
 --> (https://bugzilla.wikimedia.org/attachment.cgi?id=6172)
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.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to