Page MenuHomePhabricator

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

Description

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:

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

Details

Related Gerrit Patches:
mediawiki/extensions/VisualEditor : masterUpdate VE core submodule to master (a8116266a)
VisualEditor/VisualEditor : masterShow whitespace HTML chars in converter preview mode

Event Timeline

Restricted Application added a project: VisualEditor. · View Herald TranscriptOct 22 2017, 7:06 PM
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

https://gerrit.wikimedia.org/r/453463

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

https://gerrit.wikimedia.org/r/453463

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

https://gerrit.wikimedia.org/r/454309

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

https://gerrit.wikimedia.org/r/454309

Deskana closed this task as Resolved.Sep 2 2018, 1:49 PM