Content deleted Content added
1.0.18 (September 13, 2014) split around newlines, fixes bubbling |
1.0.19 (September 14, 2014) paragraph split after newline, bubbling to sliding |
||
Line 3:
// ==UserScript==
// @name wDiff
// @version 1.0.
// @date September
// @description improved word-based diff library with block move detection
// @homepage https://en.wikipedia.org/wiki/User:Cacycle/diff
Line 31:
* Block move detection and visualization
* Minimizing length of moved vs. static blocks
*
* Optional omission of unchanged irrelevant parts from the output
* Fully customizable
Line 143:
wDiff.regExpSplit = {
// paragraphs:
paragraph: /.*\n/g,
// sentences: after .spaces
Line 161:
}
// regExps for
if (wDiff.
if (wDiff.
// regExp for counting words
Line 551:
wDiff.CalculateDiff(text, symbols, 'word', true);
//
wDiff.
wDiff.
// split tokens into chars in selected unresolved gaps
Line 562:
wDiff.CalculateDiff(text, symbols, 'character', true);
//
wDiff.
wDiff.
}
Line 961:
// wDiff.
// start ambiguous gap borders after line breaks and text section closing characters
// changes: text (text.newText or text.oldText) .tokens list
// called from: wDiff.Diff()
wDiff.
// cycle through tokens list
Line 981:
else if ( (gapStart !== null) && (text.tokens[i].link !== null) ) {
//
var front = gapStart;
var back = i;
Line 1,009:
(text.tokens[frontTest].token == text.tokens[backTest].token)
) {
if (wDiff.
frontStop = frontTest;
break;
}
else if ( (frontStop === null) && (wDiff.
frontStop = frontTest;
}
Line 1,020:
}
// actually
if (frontStop !== null) {
while (
Line 1,513:
// repeat from start after conversion
if (unlinked === true) {
wDiff.
wDiff.
// repeat block detection from start
|