Make a more specific CSS selector in getLangsWithBadges
This should avoid problems with elements that are not real interlanguage links, which may be added by other code, for example user scripts. Bug: T267887 Change-Id: I3f9c618b417363f667a31e9dad335c1aec15b055
This commit is contained in:
@@ -329,11 +329,9 @@
|
||||
*/
|
||||
CompactInterlanguageList.prototype.getLangsWithBadges = function () {
|
||||
return Array.prototype.map.call(
|
||||
document.querySelectorAll( '#p-lang [class*="badge"]' ),
|
||||
document.querySelectorAll( '#p-lang [class*="badge"] a.interlanguage-link-target' ),
|
||||
function ( el ) {
|
||||
return mw.uls.convertMediaWikiLanguageCodeToULS(
|
||||
el.querySelector( '.interlanguage-link-target' ).lang
|
||||
);
|
||||
return mw.uls.convertMediaWikiLanguageCodeToULS( el.lang );
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user