Page MenuHomePhabricator

Diffview system - whitespace not properly indicated
Closed, ResolvedPublic

Description

Author: utopianfiat

Description:
http://en.wikipedia.org/w/index.php?title=Ares_I&action=historysubmit&diff=317703369&oldid=317700423

Note that the highlighted lines are not the lines which have changed. This is minor and probably a lot more than trivial to fix. However, the lines above any of the changes are also highlighted as changed. What's going on here?

If I missed a dupe forgive me, I searched and came up with naught.


Version: unspecified
Severity: trivial

Details

Reference
bz21351

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:46 PM
bzimport added a project: wikidiff2.
bzimport set Reference to bz21351.

overlordq wrote:

Differences in whitespace will show up like that.

EG, in the first large block of text is in the old revision is:

{{Cite web |url=

In the new revision:

{{Cite web| url=

It's kinda of hard to make whitespace in red to show that it changed. Likely INVALID as described.

overlordq wrote:

Well I take that back, since a printable has moved, in this case usually a pipe, if it showed up highlighted it'd make this more apparent.

Changing component to wikidiff2.

AutoWikiBrowser has solved this by introducing a darker shade of yellow or green on the characters themselfs.

So if:

{{Template

Param=Foo
Eater=Bar

changed to:

{{Template

Param = Foo
Eater = Bar

those spaces would would have a darker backgroud color and the diff-view itself is also in Pre-whitespace so not only is in AWB visible where the whitespace has changed also how many.

That would make great addition to the difference engine of MediaWiki.

A quick note on how AWB's diff system works. It employs a 3-pass system, as opposed to MediaWiki's 2 steps:

  1. Line-level diff
  2. Word-level diff
  3. Whitespace diff, where whitespace at the end of otherwise matching words is diffed.

To render highlighted whitespace properly, it's replaced with non-breaking spaces, thus copy-pasting from diffs can yield unexpected results.

Note that I wrote AWB's diff system based on wikidiff2, not PHP diff so if they're different...

Created attachment 10417
The diff with 1.19wmf1 (r114429) and gadget "Display diffs with the new yellow/blue color scheme and design that improves accessibility. (based on r133098)"

This looks fixed (since a while ago) with the new wikidiff, made clearer by the new colours of bug 11374.

The character where there's a difference seems to always be detected correctly, and the removed/added spaces are mostly correctly highlighted in the relevant column, too. See for instance "Avionics| publisher" -> "Avionics |publisher" and "mdy}}| accessdate" -> "mdy}} |accessdate": correct point highlighted in both, but in the second only the pipe and spaces are not highlighted.

Attached:

Diff_with_new_colours.png (768×1 px, 126 KB)

Created attachment 10418
Same diff of "Contractor selection" without style improvements

With the old style some parts of the diff were less clear but that wasn't fault of wikidiff anyway.

Attached:

Diff_with_old_colours.png (768×1 px, 248 KB)