[TASK] Change diff granularity to "word" 01/46601/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 11 Feb 2016 17:22:02 +0000 (18:22 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 11 Feb 2016 19:01:36 +0000 (20:01 +0100)
Change the granularity of diffs generated by DiffUtility to "word"
to get readable diffs.

Change-Id: Ib852f6c1a05bd9a9e55aa8821ddcd83f997ae741
Resolves: #73289
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/46601
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Utility/DiffUtility.php

index 4fd4afb..50360cc 100644 (file)
@@ -14,6 +14,7 @@ namespace TYPO3\CMS\Core\Utility;
  * The TYPO3 project - inspiring people to share!
  */
 use cogpowered\FineDiff\Diff;
+use cogpowered\FineDiff\Granularity\Word;
 
 /**
  * This class has functions which generates a difference output of a content string
@@ -40,7 +41,7 @@ class DiffUtility
             $str1 = strip_tags($str1);
             $str2 = strip_tags($str2);
         }
-        $diff = new Diff();
+        $diff = new Diff(new Word());
         return $diff->render($str1, $str2);
     }
 }