Page MenuHomePhabricator

[Epic] Render explicit reflist numbers in read mode, without relying on browser <li>
Open, Needs TriagePublic

Assigned To
None
Authored By
awight
Oct 30 2024, 8:30 AM
Referenced Files
F58185683: image.png
Jan 13 2025, 3:32 PM
F58185656: image.png
Jan 13 2025, 3:28 PM
F58185647: image.png
Jan 13 2025, 3:28 PM
F58185554: image.png
Jan 13 2025, 3:28 PM
F58185526: image.png
Jan 13 2025, 3:28 PM
F58185516: image.png
Jan 13 2025, 3:28 PM
F58185487: image.png
Jan 13 2025, 3:28 PM
F58185480: image.png
Jan 13 2025, 3:28 PM

Description

The reference list in both read modes (legacy and Parsoid) currently renders footnote item numbers in the reflist using built-in browser <li>. This is fragile but works in most simple cases. Replacing with explicit text numbers is analogous to T369614: Parsoid: explicit numbering for footnote markers but for the reference list. Only this will guarantee accurate numbering—thereby solving this list of known issues:

  • Reference list numbers are not localized in read mode for some languages, so don't match footnote markers in the article.
  • Reference list numbers aren't included in copy-paste text.
  • Can't search for reference list numbers in some browsers.

Wrong symbols in reflist when the browser lacks explicit language numbering support

For example, with firefox 133.0 on linux, the footnote markers for knwiki articles are written in Kannada script,

image.png (36×400 px, 9 KB)

while the reference list incorrectly shows fallback numbers,
image.png (119×400 px, 21 KB)

Numbers aren't included when copy-pasting from the reference list

Select any number of reference list items from any article and copy.

image.png (79×402 px, 8 KB)

When pasting as plaintext, there is no number or even indication of list item start:

image.png (79×882 px, 10 KB)

When pasting as HTML results vary, you may see an <ul> item or various English numbers with interesting formatting,

image.png (113×890 px, 11 KB)

Some browsers can't search for a reflist number

For example, go this revision and search for footnote number "186". Firefox 133.0 correctly finds the footnote number "[186]" in article text, and reflist item number "186",

image.png (81×1 px, 22 KB)

but Chrome only finds the footnote marker,
image.png (74×688 px, 31 KB)

Follow-up

Gotcha: Be aware that the numbering style includes some decoration around the number, which is specific by language, eg. "1)", "1.", "(1)" and so on.

The visual editor numbering also needs some CSS touch-up to style explicit text but this is strictly a refactor to remove the unnecessary CSS var and li::marker content, and is functionally equivalent to explicit numbering from the user perspective: T383681: Clean up visual editor reference list explicit numbering

Screenshot of VE showing correctly localized reflist numbering,

image.png (189×266 px, 22 KB)

Source editor preview is currently not localized but this is probably fixed with Parsoid?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

(needs to be split into subtasks)

awight renamed this task from [Epic] Render explicit reflist numbers, without CSS to [Epic] Render explicit reflist numbers, without relying on <li>.Jan 10 2025, 3:16 PM
awight updated the task description. (Show Details)
awight renamed this task from [Epic] Render explicit reflist numbers, without relying on <li> to [Epic] Render explicit reflist numbers in read mode, without relying on browser <li>.Jan 13 2025, 3:28 PM
awight updated the task description. (Show Details)