Last modified: 2013-04-22 16:15:55 UTC
The headers of MediaWiki's info action should have anchors, similar to anchors created by wikitext headers (i.e., "== Foo =="). The current HTML output of <https://www.mediawiki.org/wiki/MediaWiki?action=info> looks like this (for a particular section header): --- <h2>Edit history</h2> --- Ideally it would look something like this: --- <h2> <span class="mw-headline" id="Edit_history">Edit history</span></h2> --- Looking at the InfoAction.php code (<https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/actions/InfoAction.php>), it seems it's already using addHeader. So perhaps there's a flag that can be passed to this function to add the span/CSS id? Or perhaps $wgParser needs to be called? I'm not sure. It shouldn't be too difficult to add an anchor here, though. It'll need to be auto-generated to account for localization/customization of the interface messages, though. Marking this as easy.
(In reply to comment #0) > Looking at the InfoAction.php code > (<https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/actions/InfoAction.php>), > it seems it's already using addHeader. So perhaps there's a flag that can be > passed to this function to add the span/CSS id? Or perhaps $wgParser needs to > be called? I'm not sure. Hmm. I hadn't realized that the addHeader function is local to InfoAction.php. I thought this was a global function. So perhaps there's a global function that can be employed here instead? It looks like Special:Version has the behavior I want. It seems to use Xml::element('h2' ...) for this. Instead of addHeader() calling Html::element() as it does now, maybe it can simply call Xml::element()? Just a pointer for the person who ends up trying to resolve this bug.
Gerrit change #22547