splitUntil() tries to replace "original" with "part1 part2", but before this commit, it took actions in the wrong order. It added part1, then added part2, then removed original. For example:
a b original c d
become
a b part1 original c d
then
a b part2 part1 original c d
then
a b part1 original c d
This commit changes the function to first remove original, then add part2, then add part1:
a b c d
a b part2 c d
a b part1 part2 c d
Here is an example problem at the application level:
<?php
require_once('htmldiff/html_diff.php');
splitUntil() tries to replace "original" with "part1 part2", but before this commit, it took actions in the wrong order. It added part1, then added part2, then removed original. For example: a b original c d become a b part1 original c d then a b part2 part1 original c d then a b part1 original c d This commit changes the function to first remove original, then add part2, then add part1: a b c d a b part2 c d a b part1 part2 c d
Here is an example problem at the application level: <?php require_once('htmldiff/html_diff.php');
$old="Sentence
These word
"; $new="SentenceThese words
"; echo html_diff($old, $new)."\n"; ?>