Suggestion

Daisy Diff can make a real diff of html-code instead of just striping out html-tags. In GSoC 2008 the author wrote a php version for Wikipedia: http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/includes/diff/

Maybe it could also be used for the Drupal Diff module?

Daisy Diff Description

Daisy Diff is a Java library that diffs (compares) HTML files. It highlights added and removed words and annotates changes to the styling.

  • Works with badly formed HTML that can be found "in the wild".
  • The diffing is more specialized in HTML than XML tree differs. Changing part of a text node will not cause the entire node to be changed.
  • In addition to the default visual diff, HTML source can be diffed coherently.
  • Provides easy to understand descriptions of the changes.
  • The default GUI allows easy browsing of the modifications through keyboard shortcuts and links.

Demo of HTML-Diff: http://code.google.com/p/daisydiff/wiki/Examples

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scoorch’s picture

I had a detailed look at daisydiff and started integrating it into the diff module. The problem is that the PHP implementation of daisydiff is very slow when documens are longer (>4 screen pages). I talked to Guy, the developer of daisydiff and he confirmed this. The comparison does not deliver good results for longer documents. Therefore, I can not recommend using daisydiff for the diff module.

yhahn’s picture

Assigned: Unassigned » yhahn
Status: Active » Postponed

Thanks for this evaluation - please feel free to make active again if/when the performance of this library is improved.

sinasalek’s picture

andrew_rs’s picture

Daisydiff's output does look nice, however including this might be a non-starter due to license issues.

Given that Drupal is released under GPL 2 and Daisydiff Apache 2

From Various Licenses and Comments about Them - GNU Project
http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses

Apache License, Version 2.0
This is a free software license, compatible with version 3 of the GPL.
Please note that this license is not compatible with GPL version 2

sinasalek’s picture

like many other drupal modules it can be used as an optional third party. It does not have to be bounded with this module. it might also be possible to use the java version as well

Mark F’s picture

subscribing

andrew_rs’s picture

I've been playing around with a couple diff packages. I'm hoping to have a test patch of one of them up and running soon. Hopefully, I'll post back within a few days.

Murz’s picture

subscribe

andrew_rs’s picture

Status: Postponed » Needs work
FileSize
7.78 KB
281 bytes
1.32 KB
539 bytes
566 bytes

I've created a modified version that uses PEAR's Text_Diff package, which needs to already be installed on your system beforehand.

It's still quite kludgy at the moment, but it appears to work decently enough (but only for nodes in the current version).

I've attached a screenshot along with the patch files.

Also, it might be worthwhile to combine this with http://drupal.org/node/372957 to create a simple configuration screen to toggle between the diff engines and whether or not to include markup.

andrew_rs’s picture

If you're interested you might also want to look at:
http://drupal.org/project/lifewire_diff

It's only available for 5, but it also uses PEAR Text_diff and I used it as a jumping off point for my experiment. It also allows users to select between the 2 column and single column diff views.

mitchell’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Assigned: yhahn » Unassigned
Status: Needs work » Active

Bumping to 3.x branch. See #1630062: Developmental Roadmap.

mitchell’s picture

Marked #304618: HTML Filtering (How?) as a duplicate.

mitchell’s picture

Re #10: There's now an issue to #1826156: Move to Text_Diff library.

HTML-Diff support seems like it should be easy to handle after looking at #10, #304618-3: HTML Filtering (How?), Lifewire Diff, and http://stackoverflow.com/questions/1360610/how-to-show-a-comparison-of-2... .

kscheirer’s picture

Does that mean we can close out or postpone this issue?

John Franklin’s picture

Patch in #10 works in 6.x-2.3 (with some offsets.)

I agree, it's a little clunky, especially when links change, but works well enough. Thanks.

milovan’s picture

Any progress with this feature? It would be awesome!
Nvm, found it pushed in dev (https://drupal.org/node/372957).
Thanks a lot!

kenorb’s picture

Issue summary: View changes
Status: Active » Needs review
Related issues: +#372957: HTML Strip for Diff, WYSIWYG Friendly
kenorb’s picture

Status: Needs review » Closed (duplicate)

The last submitted patch, 10: diff.css_.patch, failed testing.

The last submitted patch, 10: diff.module.patch, failed testing.

The last submitted patch, 10: diff.pages_.inc_.patch, failed testing.

Status: Closed (duplicate) » Needs work

The last submitted patch, 10: node.inc_.patch, failed testing.

Alan D.’s picture

Status: Needs work » Closed (won't fix)

Closing as major developments in 7.x are not going to be continued and 8.x provides a base that includes VisualInlineDiffLayout that uses mkalkbrenner/php-htmldiff-advanced that provides a nice inline diff.