From b4e0acc50ce686cc57ca854dd319bb722d1d7f7d Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Fri, 1 Jul 2011 22:10:59 +0200 Subject: add ascii highlighting with escape color support Signed-off-by: Florian Pritz --- scripts/ansi2html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/ansi2html (limited to 'scripts/ansi2html') 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(); +my $html = $h->html; +$html =~ s/background: black; //g; +$html =~ s/color: white; /color: black /g; +$html =~ s/
/\n/g; + +print $html; -- cgit v1.2.3-24-g4f1b