
This module compares two strings of HTML and returns a list of a chunks which indicate the diff between the two input strings, where changes in formatting are considered changes.

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

Returns a reference to a list of triples [<flag>, <left>, <right>]. Concatenating all the <left> members from the return value should produce the input $left_text, and likewise for the <right> members. 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, "breaking" on visible words in the HTML 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.

Whipped up by Ezra elias kilty Cooper, ezra@ezrakilty.net

Algorithm::Diff