currently, the "[Phriction] [Edited] {DOCNAME}" notification emails only include a link to display the diff, but it would be tremendously useful to inline the diff if it is short enough. i would be more than willing to implement that, but i need some guidance:
i wrote a quick test using the included external lib "diff_match_patch":
$dmp = new diff_match_patch(); $body->addTextSection( pht('DOCUMENT DIFF'), $dmp->patch_toText($dmp->patch_make($text_old, $text_new)));
but its output is quite terrible. for example, given the input file:
Doc Title ========= Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus placerat sem sed erat maximus varius. Another line of stuff. Sub Title --------- Proin et ligula laoreet, vulputate nisi vitae, maximus lectus. Suspendisse potenti.
and changing the line Another line of stuff to Another line of text, it rendered:
DOCUMENT DIFF @@ -139,13 +139,12 @@ of -stuff +text .%0A%0AS
yuck! this is what i would want (based on years of using unified diff...):
DOCUMENT DIFF @@ -2,7 +2,7 @@ ========= Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus placerat sem sed erat maximus varius. -Another line of stuff. +Another line of text. Sub Title ---------
so, would you accept a patch to enable inline phriction diffs? and if so, do you have any ideas on how to get better diff output?