SYNOPSIS

    $result = html_word_diff($left_text, $right_text);

DESCRIPTION

Returns a reference to a list of triples [<flag>, <left>, <right>]. Each triple represents a check of the input texts. The flag tells you whether it represents a deletion, insertion, a modification, or an unchanged chunk.

Every character of each input text is accounted for by some triple in the output. Specifically, Concatenating all the <left> members from the return value should produce $left_text, and likewise the <right> members concatenate together to produce $right_text.

The <flag> is either 'u', '+', '-', or 'c', indicating whether the two chunks are the same, the $right_text contained this chunk and the left chunk didn't, or vice versa, or the two chunks are simply different. This follows the usage of Algorithm::Diff.

The difference is computed on a word-by-word basis, \*(L"breaking\*(R" on visible words in the \s-1HTML\s0 text. If a tag only is changed, it will not be returned as an independent chunk but will be shown as a change to one of the neighboring words. For balanced tags, such as <b> </b>, it is intended that a change to the tag will be treated as a change to all words in between.

AUTHOR

Whipped up by Ezra elias kilty Cooper, <[email protected]>.

Patch contributed by Adam <[email protected]>.

RELATED TO HTML::Diff…

Algorithm::Diff