Page MenuHomePhabricator

Special page for broken section links
Closed, DuplicatePublic


Section links [[Article title#Section title]] are very common in Wikipedia and other wikis. However, when a section title changes, the link stops redirecting to the section and only redirects to the article. These kind of "broken" links don't show as red, and there is no practical way to find them. As a consequence, Wikipedia and other wikis are now filled with these "broken" links. I think that a special page that lists such links would be very useful. It should probably be grouped under the "Maintenance reports" list of special pages in Special:SpecialPages, next to special pages like Special:BrokenRedirects.

Event Timeline

Sophivorus renamed this task from Maintenance report for broken section links to Special page for broken section links.Oct 13 2016, 6:07 PM
Sophivorus updated the task description. (Show Details)

As far as I know, there's nearly no easy way to find out, if a section is still present, if the page is already rendered/parsed. However, it should be possible to do that while the page is parsed. This would be an additional check for the "is known" check of the title, which would also check, if the section is present, or not. This would require to get the ParserOutput object of the linked page (this, btw., could trigger a re-render of the target page, given that there could be many pages, this could be slow, at least I would assume that). After that we could use ParserOutput::getSections() to get the raw data of the table of contents and check, if a section title is present.

However, this is just an idea, and I'm not sure, if it is possible at all, if the performance is ok or even if this is desired (links with a section would turn into "redlinks"; even if the title exists, which would be false, as far as I know).

Having a special page doing this would be, btw., a much bigger change (still, there's the problem that there's curently no place, where the data is already available :)).

@Florian I think in the end, this issue is just another one in the list of issues that depend on a better handling of sections. Red links seem like undesirable, yes, but maybe some other mark, like an HTML class that can then be detected using some optional gadget?

@brion How feasible is it to design and build a "sectionlinks" table and/or a "section" table to keep track of section links and/or the sections under each title, as well as data such as their corresponding section number, heading level, etc? Not just for this issue of course, but as a step towards a better handling of sections in general.