Last modified: 2011-11-21 09:38:35 UTC
THE PROBLEM ----------- In parser.php, this is generated by default: <span class="tocnumber">1</span> ... We want this <span class="tocnumber">1.</span> ... So we don't have headings like these that appear to give a content-count that isn't intended: 1 Overview 2 Major Enhancements 3 Significant Changes 4 Bugs Fixed 5 Open Issues We want this instead, especially when using the __NUMBEREDHEADINGS__ extension, so the headings don't mislead readers: 1. Overview 2. Major Enhancements 3. Significant Changes 4. Bugs Fixed 5. Open Issues MY PATCH -------- In includes/parser/parser.php, I replaced replaced lines 3509..3520 (from comment at the top of the section to the end of the for loop), with these lines: # count number of headlines for each level @$sublevelCount[$toclevel]++; # An array of heading numbers, one per level, where everything # after 1.2 (for example) is "empty": [1, 2, empty, empty, empty] $dot = 0; # No dot before the first number. for( $i = 1; $i <= $toclevel; $i++ ) { if( !empty( $sublevelCount[$i] ) ) { // Add a dot before this non-empty sublevel index // (There's no dot after the last one) if( $dot ) { $numbering .= '.'; } $numbering .= $wgContLang->formatNum( $sublevelCount[$i] ); $dot = 1; } } if ($toclevel == 1) { # We're at a level one head. Add a dot after it. $numbering .= '.'; } }
The final brace in the code segment I pasted is indented one level too far.
Please attach a patch file instead of pasting code and replace instructions into a bug comment.
I'm not so sure we want this change; inclined towards WONTFIX.
(In reply to comment #3) > I'm not so sure we want this change; inclined towards WONTFIX. Agreed, WONTFIXing.
Eric, if you'd like to see how to do this for your own personal view of MediaWiki headings or on a wiki you run, come talk to us in #mediawiki on Freenode IRC to talk about doing it, possibly with a user script or gadget in JavaScript.