https://bugzilla.wikimedia.org/show_bug.cgi?id=29302
Web browser: ---
Bug #: 29302
Summary: Add a period after Level-1 numbered headings
Product: MediaWiki
Version: 1.15.x
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: General/Unknown
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
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 .= '.';
}
}
--
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