jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369807 )

Change subject: Restore non-mangled anchors in API help in all cases
......................................................................


Restore non-mangled anchors in API help in all cases

Prior to Id304010a, the API help included non-mangled anchors even when
$wgExperimentalHtmlIds was false. This was lost in Id304010a when the
new $wgFragmentMode is [ 'legacy' ], as is the default, despite the loss
being pointed out multiple times in code review.

Change-Id: Ibcb86deb4e3ea2131211f184f46960e5ad390212
---
M includes/api/ApiMain.php
1 file changed, 12 insertions(+), 3 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php
index f6dd524..e69300b 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -1933,14 +1933,18 @@
 
                        $id = Sanitizer::escapeIdForAttribute( 
'main/datatypes', Sanitizer::ID_PRIMARY );
                        $idFallback = Sanitizer::escapeIdForAttribute( 
'main/datatypes', Sanitizer::ID_FALLBACK );
-
-                       $help['datatypes'] .= Linker::makeHeadline( min( 6, 
$level ),
+                       $headline = Linker::makeHeadline( min( 6, $level ),
                                ' class="apihelp-header"',
                                $id,
                                $header,
                                '',
                                $idFallback
                        );
+                       // Ensure we have a sane anchor
+                       if ( $id !== 'main/datatypes' && $idFallback !== 
'main/datatypes' ) {
+                               $headline = '<div id="main/datatypes"></div>' . 
$headline;
+                       }
+                       $help['datatypes'] .= $headline;
                        $help['datatypes'] .= $this->msg( 'api-help-datatypes' 
)->parseAsBlock();
                        if ( !isset( $tocData['main/datatypes'] ) ) {
                                $tocnumber[$level]++;
@@ -1957,13 +1961,18 @@
                        $header = $this->msg( 'api-credits-header' )->parse();
                        $id = Sanitizer::escapeIdForAttribute( 'main/credits', 
Sanitizer::ID_PRIMARY );
                        $idFallback = Sanitizer::escapeIdForAttribute( 
'main/credits', Sanitizer::ID_FALLBACK );
-                       $help['credits'] .= Linker::makeHeadline( min( 6, 
$level ),
+                       $headline = Linker::makeHeadline( min( 6, $level ),
                                ' class="apihelp-header"',
                                $id,
                                $header,
                                '',
                                $idFallback
                        );
+                       // Ensure we have a sane anchor
+                       if ( $id !== 'main/credits' && $idFallback !== 
'main/credits' ) {
+                               $headline = '<div id="main/credits"></div>' . 
$headline;
+                       }
+                       $help['credits'] .= $headline;
                        $help['credits'] .= $this->msg( 'api-credits' 
)->useDatabase( false )->parseAsBlock();
                        if ( !isset( $tocData['main/credits'] ) ) {
                                $tocnumber[$level]++;

-- 
To view, visit https://gerrit.wikimedia.org/r/369807
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibcb86deb4e3ea2131211f184f46960e5ad390212
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to