Re: Inline diff coded in PHP

From: Date: Tue, 17 Aug 2004 17:14:44 +0000
Subject: Re: Inline diff coded in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-194062@lists.php.net to get a copy of this message
On Mon, 16 Aug 2004 11:22:30 +0300, Skippy <skippy@zuavra.net> wrote: > I'm looking for PHP code that will produce diff's between two texts, and > render them "inline". By that I mean not the standard *nix diff output, > which compares and outputs lines, but a diff that compares inline text > and outputs the bits before and after in place, marked with a custom > <span> or something. > > Example of *nix diff: > > - this is the old line > + this is the new line > > Example of what I need: > > this is the <span class="old">old</span> <span > class="new">new</span> line > > I've seen this done in the htmldiff package, which is a C program. Except > I don't want to diff HTML code, but regular text. I actually need this > for a wiki engine, so it can present diffs between page changes in a > better way. > > So: > * Anybody seen such code? the PEAR diff only does line diffs. > * Know of any GPL'd wiki engine which has my kind of diffs already > implemented (as PHP?) > * Any pointers about how I should go about writing my own such diff? > There's a python program called CVSSpam that does somehting like that. It does line changes, but also highlights the changes within the line. Sorry, I know of no in-line PHP diff engine. -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin--

« previous php.general (#194062) next »