User:Ucucha/duplinks.js: Difference between revisions

Content deleted Content added
fix typo, thanks The Bushranger
check only links within p tags
Line 7:
e.preventDefault();
// create a separate div surrounding the lead
// first get the element immediately surrounding the article text. Unfortunately, MW doesn't seem to provide a non-fragile way for that.
var content = ".mw.util.$-content.children()[2]-ltr";
$(content).prepend(document.createElement('div'));
var lead = $(content).children()[0];
Line 33 ⟶ 34:
}
}
return true;
};
var// array to keep track of whether we've seen =a link {};before
var seen = [];
mw.util.$content.find('p a').not('#lead *, .infobox *, .navbox *').each(finddups);
var seen = {}[];
mw.util.$content.find('#lead p a').not('.infobox *, .navbox *').each(finddups);
});
});