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 );
$parserOutput->appendExtensionData( 'tabber-count', $count++ );
$parserOutput->appendExtensionData( 'tabber-count', ++$count );
if ( self::$useCodex === true ) {
$parser->getOutput()->addModules( [ 'ext.tabberNeue.codex' ] );

View file

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

View file

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