Page MenuHomePhabricator

Page sections can generate duplicate IDs, which makes TOC unable to reference them
Closed, DuplicatePublic

Description

Each section of a page gets a unique HTML id in their header based on the section header text. If there are multiple sections with the same header text, the second ID gets a _2 suffix, the third a _3 suffix, etc. That's good, but it causes a conflicting ID when there's another section with the same header text and a " 2" suffix, etc.

The problem, apart from the duplicate HTML id, is that the TOC is unable to link to one of those sections.

This problem is common on english wiktionary, because they have duplicate section names very often: They use "Etymology" for each language, and if one language have several homonym terms, one is named "Etymology", the second "Etymology 2", etc.

Examples:

https://en.wiktionary.org/w/index.php?title=malo&oldid=31741753

Galician->Etymology has the same ID than Latin->Etymology_2

https://en.wiktionary.org/w/index.php?title=si&oldid=30849625

Catalan->Etymology_2 has the same ID than Dalmatian->Etymology


See also: T7019, T2111, T4831

Event Timeline

Ciencia_Al_Poder raised the priority of this task from to Needs Triage.
Ciencia_Al_Poder updated the task description. (Show Details)
Ciencia_Al_Poder added a subscriber: Ciencia_Al_Poder.

Whoops, yes. I was searching a lot on phabricator trying to see if a report already existed, but I was unable to find it :( I was pretty sure it had been reported already. Merging them...