HTMLDiff
I’ve wanted to add an HTML Diff to Planet for some time, and the notion itself raises a number of interesting questions.
- What should the latest version be compared against, the previously fetched version or the original version? I’d like to keep the interface as stateless as possible.
- Does it make sense to ‘diff’ MathML? SVG?
In my investigation, I took a peek at Aaron Swartz’s HTMLDiff, which turns out to be a thin wrapper around Python’s difflib. My first test was to try taking a single word and make it bold: before, after.
Easy enough? See for yourself.