Merge "DesktopArticleTarget.init: Ignore fake section edit links added by gadgets"

This commit is contained in:
jenkins-bot 2023-02-13 23:39:26 +00:00 committed by Gerrit Code Review
commit 2dd4987b57

View file

@ -840,6 +840,11 @@
// Add section is currently a wikitext-only feature
'#ca-addsection a'
).each( function () {
if ( !this.href ) {
// Not a real link, probably added by a gadget or another extension (T328094)
return;
}
var linkUrl;
try {
linkUrl = new URL( this.href );
@ -1227,6 +1232,11 @@
* @param {string} [section] Override edit section, taken from link URL if not specified
*/
onEditSectionLinkClick: function ( mode, e, section ) {
if ( !e.target.href ) {
// Not a real link, probably added by a gadget or another extension (T328094)
return;
}
var linkUrl;
try {
linkUrl = new URL( e.target.href );