or download this
my %class =(AGGAG => { name => 'sd' },
TT => { name => 'terminator' }); # I shortened the ter
+minator for testing
...
my $class = $highlight{$key}{$pos};
wrap(\@lines, $pos + $class->{length}, '</span>');
wrap(\@lines, $pos, "<span class='$class->{name}'>");