mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-15 03:34:03 +00:00
Add missing escaping for jQuery ID selector
We run into this issue already one time, see Ifb5fe89 (T214710). The exact same applies here. The effect of this bug is that for certain references (typically ones with a colon character in their name) the "jump down" link will be broken. Change-Id: Ic6723bd910cb5e5e1e1872ce39f2e271012245de
This commit is contained in:
parent
d816f230b5
commit
932271b6db
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map.json
vendored
BIN
resources/dist/index.js.map.json
vendored
Binary file not shown.
|
@ -7,7 +7,8 @@ import { escapeHTML } from '../templateUtil';
|
|||
|
||||
// Known citation type strings currently supported with icons and messages.
|
||||
const KNOWN_TYPES = [ 'book', 'journal', 'news', 'web' ],
|
||||
mw = mediaWiki;
|
||||
mw = mediaWiki,
|
||||
$ = jQuery;
|
||||
|
||||
/**
|
||||
* @param {ext.popups.PreviewModel} model
|
||||
|
@ -51,7 +52,7 @@ export function renderReferencePreview(
|
|||
if ( model.sourceElementId ) {
|
||||
$el.find( '.mwe-popups-read-link' ).on( 'click', ( event ) => {
|
||||
event.stopPropagation();
|
||||
$( `#${ model.sourceElementId } > a` ).trigger( 'click' );
|
||||
$( `#${ $.escapeSelector( model.sourceElementId ) } > a` ).trigger( 'click' );
|
||||
} );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue