summaryrefslogtreecommitdiffstats
path: root/scripts/ansi2html
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/ansi2html')
-rwxr-xr-xscripts/ansi2html20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/ansi2html b/scripts/ansi2html
new file mode 100755
index 000000000..e33e24630
--- /dev/null
+++ b/scripts/ansi2html
@@ -0,0 +1,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;