I've to allow annotations in a HTML file by multiple users and merge annotations on server side. My example files are:
file1.html
<div class="a1 b1">This is example text by Kapil and Krish</div>
User 1 changes (annotations) file2a.html
<div class="a1 b1">This is example text by <span class='comment_123'>Kapil</span> and Krish</div>
User 2 changes file2b.html
<div class="a1 b1">This is example text by Kapil and <span class='comment_234'>Krish</span></div>
Expected output file2.html
<div class="a1 b1">This is example text by <span class='comment_123'>Kapil</span> and <span class='comment_234'>Krish</span></div>
On server side, I'm using PHP's xdiff_file_merge function. That works well in case changes are on different line but on same line, it gives error.
Is there any way handle that error using custom code, only for line having conflicts. Currently, in case of conflicts, file2.html (expected output) is exact copy of file2a.html (user 1 changes).
Even outside php (linux commands), is there any way to handle conflicts during file merge?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire