Home » Text » Text_Diff » Bug #4982
diff on a little bit wrong place with inline renderer
Details
| Request #4982 | diff on a little bit wrong place with inline renderer |
|---|---|
| Submitted | 2005-08-03 10:35 UTC |
| From | thomas at luz-webwide dot de |
| Status | Open |
| Package | Text_Diff |
| PHP Version | 5.0.4 |
| OS | windows 2000 |
| Roadmaps | (Not assigned) |
Comments
[2005-08-03 10:35 UTC] thomas at luz-webwide dot de
Description:
------------
The following script shows the new line not at the exact position.
The two files are :
/* 1.txt :
This line is the same.
This line is different in 1.txt
This line is the same.
This is gone away !!
*/
/* 2.txt
This line is the same.
This is new !!
This line is different in 2.txt
This line is the same.
*/
Test script:
---------------
.*)";
$regexnew = "(.*)";
$text = $renderer->render($diff);
$textold = preg_replace($regexold,'',$text);
$textnew = preg_replace($regexnew,'',$text);
?>
DIFF TEST
ins {background-color: Lime;}
del {background-color: Red;}
div {border: medium;border-color: blue; border-style: solid; width: 300px;background-color: #EEEEEE;}
Expected result:
----------------
The new line should appear as a single line,
actualy it is shown on two lines (see html below).
Actual result:
--------------
This line is the same.
This is new !!
This line is different in 1.txt2.txt
This line is the same.
This is gone away !!
This line is the same.
This is new !!
This line is different in 2.txt
This line is the same.
This line is the same.
This is new !!
This line is different in 1.txt
This line is the same.
This is gone away !!
[2005-08-03 10:56 UTC] thomas at luz-webwide dot de
The actual result is :
This line is the same.
This<ins> is new !!
This</ins> line is different in <del>1.txt</del><ins>2.txt</ins>
This line is the same.
<del>This is gone away !!</del>
The expected result is :
This line is the same.
<ins>This is new !!</ins>
This line is different in <del>1.txt</del><ins>2.txt</ins>
This line is the same.
<del>This is gone away !!</del>
[2005-08-03 11:59 UTC] thomas at luz-webwide dot de
I dont think that its correct.
Try "Hello I'm new" as the new line.
The result is :
This line is the same.
<del>This</del><ins>Hello I'm new !
This</ins> line is different in ....