! Copyright (C) 2008, 2010 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel lcs sequences strings xml.syntax xml.writer ; IN: lcs.diff2html GENERIC: diff-line ( obj -- xml ) : item-string ( item -- string ) item>> [ CHAR: no-break-space 1string ] when-empty ; M: retain diff-line item-string [XML <-> XML] dup [XML <-><-> XML] ; M: insert diff-line item-string [XML <-> XML] ; M: delete diff-line item-string [XML <-> XML] ; : htmlize-diff ( diff -- xml ) [ diff-line ] map [XML <->
OldNew
XML] ;