Are there any libraries for showing diffs between two web pages?

Posted by Chad Johnson on Stack Overflow See other posts from Stack Overflow or by Chad Johnson
Published on 2010-05-13T18:14:51Z Indexed on 2010/05/13 18:44 UTC
Read the original article Hit count: 319

Filed under:
|

I am looking for a library in any language--preferably PHP though--that will display the difference between two web pages. The differences can be displayed side-by-side, all in one document, or in any other creative way.

Examples of what this would look like:

I am NOT looking for raw code diffing, like this: http://thinkingphp.org/img/code_coverage_html_diff_view.png. I do NOT want to show the difference between two sets of HTML. I want to show differences in rendered, WYSIWYG form.

Every solution I tried suffered from one or more of the following problems:

  • If I change the attribute of an element (eg. change [table border="1"] to [table border="2"]), then I'll have an extra table tag in the output (eg. [table border="1"][table border="1"][tr][td]...). And, one table tag will have a del tag around it, while the other will have an ins tag around it, and that will obviously cause problems.
  • If I change [html][body][b]some content here[/b][/body][/html] to [html][body][i]some other content here[/i][/body][/html] then it looks like [html][body][b][del]original[/del][i][ins]new[/ins] content here[/b][/i][/body][/html]

I'm looking for out-of-the-box ideas. Any ideas are welcome.

© Stack Overflow or respective owner

Related posts about diff

Related posts about php