Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/57187
Change subject: Alpha: Diff words rather than chars
......................................................................
Alpha: Diff words rather than chars
Experimenting this seems like a much better idea
I think this will make jgonera happier :)
Change-Id: I78b37acb0a85575870f316a9ad679a1305da7093
---
M javascripts/specials/mobilediff.js
M tests/js/specials/mobilediff.js
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/87/57187/1
diff --git a/javascripts/specials/mobilediff.js
b/javascripts/specials/mobilediff.js
index eeef134..1c70966 100644
--- a/javascripts/specials/mobilediff.js
+++ b/javascripts/specials/mobilediff.js
@@ -27,7 +27,7 @@
$add = $add.next();
}
- diffChars = JsDiff.diffChars(
$del.text(), $add.text() );
+ diffChars = JsDiff.diffWords(
$del.text(), $add.text() );
diffChars.forEach( function( change ) {
var tag;
if ( change.added ) {
diff --git a/tests/js/specials/mobilediff.js b/tests/js/specials/mobilediff.js
index 26f2d15..c2e4c37 100644
--- a/tests/js/specials/mobilediff.js
+++ b/tests/js/specials/mobilediff.js
@@ -17,7 +17,7 @@
],
[
$( '<div id="mw-mf-minidiff"><del>A total of 40
consulates-generals and 24 honorary consulates have offices in the San
Francisco Bay Area.</del><ins>A total of 41 consulates-generals and 24 honorary
consulates have offices in the San Francisco Bay Area.</ins></div>' ),
- '<span>A total of
4</span><ins>1</ins><del>0</del><span> consulates-generals and 24 honorary
consulates have offices in the San Francisco Bay Area.</span><br>'
+ '<span>A total of
</span><ins>41</ins><del>40</del><span> consulates-generals and 24 honorary
consulates have offices in the San Francisco Bay Area.</span><br>'
],
[
$( '<div id="mw-mf-minidiff"><del></del><del>==
Fliberty gibbit ==</del><del>Foobar!</del></div>' ),
--
To view, visit https://gerrit.wikimedia.org/r/57187
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I78b37acb0a85575870f316a9ad679a1305da7093
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits