Page MenuHomePhabricator

Ignore leading or trailing whitespaces when match lines
Closed, ResolvedPublic

Description

When have a diff, where the leading or trailing whitespace of some lines is changed, the lines are not matched to its original line. This often happen when diff javascript pages, where the indentation of some lines is changed.

It is possible to ignore leading and trailing whitespaces, when match the lines of the both revision? Thanks.

Example (not javascript page):
http://de.wikipedia.org/w/index.php?title=Daihatsu_Cuore&diff=72851766&oldid=72377298

When adding one space at the end of line 193 the diff works as expected

also works fine with diff other way round:
http://de.wikipedia.org/w/index.php?title=Daihatsu_Cuore&diff=72377298&oldid=72851766


Version: unspecified
Severity: enhancement

Details

Reference
bz23704

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:01 PM
bzimport added a project: wikidiff2.
bzimport set Reference to bz23704.

I see on both cases that space changes result in "white-green" diffs with no red letter.
Maybe we could have a parameter to do ignore-space diffs, or give those lines a different class.

Created attachment 7414
screenshot of diffs

(In reply to comment #1)

I see on both cases that space changes result in "white-green" diffs with no
red letter.

I have add a screenshot of the both links, there are red letters.

Maybe we could have a parameter to do ignore-space diffs, or give those lines a
different class.

that is maybe bug 21351

Attached:

diff.PNG (1×1 px, 136 KB)

I see now what you mean.
The line * Neu: Servolenkung, Zentralverriegelung,... got a space difference and moved down in the comparison for no good reason.

For the record: this diff seems to be trimming leading spaces.

(In reply to comment #3)

I see now what you mean.
The line * Neu: Servolenkung, Zentralverriegelung,... got a space difference
and moved down in the comparison for no good reason.

Duping to bug 13462 then.

For the record: this diff seems to be trimming leading spaces.

More for the record: see for instance the single space removed from the otherwise empty line after the "* Normverbrauch:" line.
It's correct for wikidiff to report such differences, IMHO: they are clearer with the new style and it's still a style change if we want to hide them (make them less visible), so perhaps bug 35923 would be the place.

  • This bug has been marked as a duplicate of bug 13462 ***