diff options
-rwxr-xr-x | localworddiff | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/localworddiff b/localworddiff index e26e50c..1561684 100755 --- a/localworddiff +++ b/localworddiff @@ -22,16 +22,16 @@ use Text::WordDiff; use Text::Markdown qw[markdown]; use CSS::Tiny; -use HTML::HTML5::Builder qw[:standard];; +use HTML::HTML5::Builder qw[:standard]; use File::Slurp; use strictures 1; use autodie; -my ($infile1, $infile2, $outfile) = @ARGV; +my ( $infile1, $infile2, $outfile ) = @ARGV; die 'Missing input file arguments' - unless ($infile1 and $infile2); + unless ( $infile1 and $infile2 ); # use console if no output file provided as third argument unless ($outfile) { @@ -43,19 +43,19 @@ unless ($outfile) { my $diff = word_diff $infile1, $infile2, { STYLE => 'HTMLTwoLines' }; # apply markup to each file div of resolved diff -my $d = "<div class=\"file\">"; +my $d = "<div class=\"file\">"; my $d_ = "<\/div>"; my $i; my @diffchunk; foreach ( split /(?:$d_\n)?$d/, $diff ) { if ($_) { - $diffchunk[$i++] = $d.markdown($_).$d_; + $diffchunk[ $i++ ] = $d . markdown($_) . $d_; } } # parse styling my $css = CSS::Tiny->new(); -$css->read_string (<<'EOF'); +$css->read_string(<<'EOF'); .fileheader { display: none; visibility: hidden; @@ -80,11 +80,11 @@ EOF # compose and save web page my $page = html( head( - XML_CHUNK($css->html), + XML_CHUNK( $css->html ), ), body( - CHUNK($diffchunk[0]), - CHUNK($diffchunk[1]), + CHUNK( $diffchunk[0] ), + CHUNK( $diffchunk[1] ), ), ); write_file( $outfile, $page ); |