HomePhabricator

Fix highlighting code destroying backlinks on unnamed <ref>s

Authored by thiemowmde on Feb 20 2019, 3:04 PM.

Description

Fix highlighting code destroying backlinks on unnamed <ref>s

There are multiple formats for these IDs:

cite_ref-1, cite_ref-2, and so on for anonymous <ref>s without a name.

cite_ref-name_1-0 for named references, where "name" is the custom name,
and "_1" is the sequential number for the reference (same number as above).
The final "-0" is counting the usages. If a named <ref> is only used once,
there is no cite_ref-name_1-1 anywhere on the page.

The later was already checked by the code. But we forgot about unnamed
references! As a consequence IDs like the cite_ref-1 above got misdetected
as reused references.

This patch tries hard to extract code into named functions, so it becomes
much more clear what they do, and why.

Bug: T215317
Change-Id: Iedb5b0c3dffae19bad7df9a43ed2d4512b3921ec

Details

Committed
thiemowmdeFeb 20 2019, 3:40 PM
Parents
rECITe71dcc355d88: Add missing jQuery selector escaping
Branches
Unknown
Tags
Unknown
References
refs/changes/74/491774/2
ChangeId
Iedb5b0c3dffae19bad7df9a43ed2d4512b3921ec