r38323 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r38322 | r38323 (on ViewVC) | r38324 >
Date:00:22, 1 August 2008
Author:jhsoby
Status:ok
Tags:
Comment:Changing the code rendered for headers; removing <a name="$anchor">, making into <h# id="$anchor"> instead. This removes one line from the output code, but more importantly enables CSS marking of a title based on its id. Probably not backwards-compatible with browsers like IE4 (brion checked with IE5) and Netscape 4, but hey, who cares?
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Linker.php
===================================================================
--- trunk/phase3/includes/Linker.php	(revision 38322)
+++ trunk/phase3/includes/Linker.php	(revision 38323)
@@ -1488,7 +1488,7 @@
 	 * @return string HTML headline
 	 */
 	public function makeHeadline( $level, $attribs, $anchor, $text, $link ) {
-		return "<a name=\"$anchor\"></a><h$level$attribs$link <span class=\"mw-headline\">$text</span></h$level>";
+		return "<h$level id=\"$anchor\"$attribs$link <span class=\"mw-headline\">$text</span></h$level>";
 	}
 
 	/**
Views
Toolbox