1 ! Copyright (C) 2008 Slava Pestov
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: lcs html.elements kernel ;
4 FROM: accessors => item>> ;
6 FROM: sequences => each if-empty ;
7 FROM: xml.entities => escape-string ;
10 GENERIC: diff-line ( obj -- )
12 : write-item ( item -- )
13 item>> [ " " ] [ escape-string ] if-empty write ;
18 <td "retain" =class td>
27 <td "insert" =class td>
34 <td "delete" =class td>
40 : htmlize-diff ( diff -- )
41 <table "100%" =width "comparison" =class table>
42 <tr> <th> "Old" write </th> <th> "New" write </th> </tr>