id => $file,
call => sub {
my %params=@_;
- highlight($langfile, $params{content});
+ highlight($langfile, $file, $params{content});
},
longname => sprintf(gettext("Source code: %s"), $file),
@opts,
return;
}
- return Encode::decode_utf8(highlight($langfile, shift));
+ return Encode::decode_utf8(highlight($langfile, $format, shift));
}
my %ext2lang;
# Interface to the highlight C library.
sub highlight ($$) {
my $langfile=shift;
+ my $extorfile=shift;
my $input=shift;
eval q{use highlight};
$gen=$highlighters{$langfile};
}
- return $gen->generateString($input);
+ return "<div class=\"highlight-$extorfile\">".$gen->generateString($input)."</div>";
}
1