This works well for strings: http://ejohn.org/projects/javascript-diff-algorithm/
And I used the line on the server side (in ruby), but it is very difficult to also take into account the structure of the forced tag, as in the tables.
What I did with just the non-html table was too complex a complement to the added and deleted text / inline elements. This method works well until you start trying to split the TD groups.
So, is there a Javascript library there that will generate visual diff with tables?
UPDATE / Example:
Table1: Table 2: <table> <table> <tr> <tr> <td>sometext</td> <td>some <b>text</b></td> <td>moretext</td> <td><b>more text</b></td> </tr> <tr> </table> </table>
The resulting table (just an opportunity, as there are many ways to show the differences)
<table> <tr> <td>some<del>text</del><add> <b>text</b></add></td> <td><del>more text</del><add><b>more text</b></add></td> </tr> </table>
javascript jquery string diff html-table
NullVoxPopuli
source share