summaryrefslogtreecommitdiffstats
path: root/scripts/ansi2html
blob: e33e246304e695e6aff9d13f1ecefbc30a015afd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
use strict;
use HTML::FromANSI ();

my $h = HTML::FromANSI->new(
		fill_cols => 0,
		font_face => "",
		style => "",
		tt => 0
);

open IN,  "<", $ARGV[0]  or die "cannot read $ARGV[0]: $!";

$h->add_text(<IN>);
my $html = $h->html;
$html =~ s/background: black; //g;
$html =~ s/color: white; /color: black /g;
$html =~ s/<br>/\n/g;

print $html;