fix: various issues found in code review

This commit is contained in:
alistair3149 2024-11-16 03:08:26 -05:00 committed by alistair3149
parent 9e8ac878cc
commit 1f75afc217
3 changed files with 4 additions and 6 deletions

View file

@ -63,7 +63,7 @@ class Tabber {
$html = self::render( $input, $count, $parser, $frame ); $html = self::render( $input, $count, $parser, $frame );
$parserOutput->appendExtensionData( 'tabber-count', $count++ ); $parserOutput->appendExtensionData( 'tabber-count', ++$count );
if ( self::$useCodex === true ) { if ( self::$useCodex === true ) {
$parser->getOutput()->addModules( [ 'ext.tabberNeue.codex' ] ); $parser->getOutput()->addModules( [ 'ext.tabberNeue.codex' ] );

View file

@ -424,8 +424,9 @@ class TabberBuilder {
if ( !urlHash ) { if ( !urlHash ) {
return activeTab; return activeTab;
} }
const idFromUrlHash = urlHash.replace( 'tabber-tabpanel-', 'tabber-tab-' ); const escapedHash = mw.util.escapeIdForAttribute( urlHash );
if ( idFromUrlHash === urlHash ) { const idFromUrlHash = escapedHash.replace( 'tabber-tabpanel-', 'tabber-tab-' );
if ( idFromUrlHash === escapedHash ) {
return activeTab; return activeTab;
} }
const activeTabFromUrlHash = document.getElementById( idFromUrlHash ); const activeTabFromUrlHash = document.getElementById( idFromUrlHash );

View file

@ -33,9 +33,6 @@ ve.ce.MWTabberTranscludeNode.static.primaryCommandName = 'mwTabberTransclude';
ve.ce.MWTabberTranscludeNode.static.lastHeader = null; ve.ce.MWTabberTranscludeNode.static.lastHeader = null;
/* Methods */ /* Methods */
// eslint-disable-next-line no-var
var lastHeader;
/** /**
* @inheritdoc * @inheritdoc
*/ */