MediaWiki:Gadget-find-archived-section.js: Difference between revisions

Content deleted Content added
proper fix for section headers with double quotes in title, without breaking other stuff
fix cases where exact matches weren't being obtained
Line 50:
} else {
divHtml = 'Looks like the discussion "' + sectionName + '" has been archived. ' ;
 
var discussionLink = $(html).find('ul.mw-search-results .searchalttitle a').attr('href');
var discussionLink;
// obtain the the first exact section title match (which would be from the most recent archive)
// this loop iterates over just one item in the vast majority of cases
var discussionLink = $(html).find('ul.mw-search-results .searchalttitle a').attreach(function('href'); {
if (this.textContent === sectionName) {
discussionLink = this.getAttribute('href');
return false; // break
}
});
 
if (discussionLink) {