// Sequencing handles lineterminator to <br /> and every-other consequtive space to a
//
String[] alpha = sequence( TextUtil.replaceEntities( wikiOld ) );
String[] beta = sequence( TextUtil.replaceEntities( wikiNew ) );
Revision rev = null;
try
{
rev = Diff.diff( alpha, beta, new MyersDiff() );
}
catch( DifferentiationFailedException dfe )
{
log.error( "Diff generation failed", dfe );
return "Error while creating version diff.";
}
int revSize = rev.size();
StringBuffer sb = new StringBuffer();
sb.append( m_diffStart );
//
// The MyersDiff is a bit dumb by converting a single line multi-word diff into a series
// of Changes. The ChangeMerger pulls them together again...
//
ChangeMerger cm = new ChangeMerger( sb, alpha, revSize );
rev.accept( cm );
cm.shutdown();
sb.append( m_diffEnd );