Page MenuHomePhabricator

Single line breaks shown a little strangely
Closed, ResolvedPublic8 Estimated Story Points


Given wikitext on consecutive lines, such as this:

O what a goo
se I am

the result will be shown to the reader as a single line, with the stray break being turned into a space: O what a goo se I am

In the visual diff, it looks like these are being shown as separate lines, which feels a little strange:

Screen Shot 2017-10-22 at 11.53.43 AM.png (715×1 px, 294 KB)

It is, however, a dramatic improvement over the wikitext diff for the same change:

Screen Shot 2017-10-22 at 11.54.13 AM.png (714×1 px, 192 KB)

Event Timeline

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

Since line breaks are shown as while editing in VE, it probably would make sense to use <del>↵</del><ins>&nbsp;</ins> to show such a diff.

Deskana triaged this task as Medium priority.Oct 23 2017, 9:42 AM
Deskana set the point value for this task to 1.
Deskana moved this task from To Triage to TR6: Visual diffs on the VisualEditor board.

This behaviour is caused by the CSS fix to T170114, which preserves whitespace in removed/inserted content, so we can see removed/inserted spaces properly. There's a slight inconsistency in this fix: whitespace is collapsed if content is unchanged, and preserved if content is changed.

I agree that preserving line breaks is confusing, since they're not preserved in the visual editor view, and that it would be better to replace them with .

I think we should also use within the unchanged content, because otherwise the mixture of read and edit views could get confusing. (I suspect that in most cases, the inconsistency with collapsing/not collapsing spaces won't really be noticeable.) Also, the diff view already has some similarities to the edit view, e.g. showing comments.

Change 453463 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[VisualEditor/VisualEditor@master] Show whitespace HTML chars in converter preview mode

Esanders edited projects, added VisualEditor (Current work); removed VisualEditor.
Esanders changed the point value for this task from 1 to 8.
Esanders moved this task from Incoming to Code review on the VisualEditor (Current work) board.

Change 453463 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Show whitespace HTML chars in converter preview mode

Change 454309 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (a8116266a)

Change 454309 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (a8116266a)