Page MenuHomePhabricator

References with [page needed] are misaligned
Closed, ResolvedPublic

Assigned To
Authored By
ABorbaWMF
May 4 2017, 9:28 PM
Referenced Files
F8548811: gordon-apple.png
Jun 28 2017, 6:50 PM
F8548815: apple1.png
Jun 28 2017, 6:50 PM
F8548818: apple2.png
Jun 28 2017, 6:50 PM
F8548820: Simulator Screen Shot 28 июня 2017 г., 21.39.48.png
Jun 28 2017, 6:50 PM
F8548649: apple-system.png
Jun 28 2017, 6:50 PM
F8548652: helvetica.png
Jun 28 2017, 6:50 PM
F8533383: Simulator Screen Shot 27 июня 2017 г., 0.35.09.png
Jun 26 2017, 9:51 PM
F7915567: image.png
May 4 2017, 9:28 PM

Description

Steps:

  1. Go to enwiki - Race (human categorization)
  2. Tap Reference 7
  3. Tap Reference 17

Notice the alignment of the [page needed] text is slightly off. On Reference 17 it pushes the lists up a bit.

image.png (638×478 px, 156 KB)
image.png (638×478 px, 170 KB)

Beta App 5.5.0 (1129)

Event Timeline

JMinor renamed this task from References with [page needed] are misaligned aligned to References with [page needed] are misaligned.May 8 2017, 6:53 PM
JMinor triaged this task as Lowest priority.
JMinor moved this task from Product Backlog to Bug Backlog on the Wikipedia-iOS-App-Backlog board.
JMinor added a project: good first task.

Oops look like this ticket may have misdiagnosed the problem. Superscripts are not misaligned - they're supposed to be higher - hence the 'super' part.

I think the problem here is the line spacing is so tight that the superscript encroaches/messes up the line spacing.

We may want to consider increasing the line spacing to match what's used on the article itself to give superscripts the 'breathing room' they need.

I have changed styles for references according to articles styles

Simulator Screen Shot 27 июня 2017 г., 0.35.09.png (1×640 px, 118 KB)

You pass HTML to NSAttributedString and iOS has strange behaviour when trying to render numbers and ordinary letters using by system font.
Ordinary letters will be rendered successfully but number's rendering will be failed for standard Apple system font, SF as I know.
This simple text with superscript will be rendered differently for -apple-system and Helvetica.
It's related to NSAttributedString only, not WKWebKit.

<html>
<head>
<style>
* { font-family:-apple-system; }
</style>
</head>
<body>
test<sup>1a2bc3</sup>
</body>
</html>

apple-system.png (46×112 px, 3 KB)

gordon-apple.png (43×284 px, 8 KB)

apple1.png (46×239 px, 6 KB)

* { font-family:Helvetica, Arial, Sans-serif; }

helvetica.png (43×113 px, 3 KB)

apple2.png (76×403 px, 15 KB)

Simulator Screen Shot 28 июня 2017 г., 21.39.48.png (84×350 px, 14 KB)

I assume that this is fixed by the merged patch.