eval q{use highlight};
if (highlight::DataDir->can('new')) {
$data_dir=new highlight::DataDir();
- $data_dir->searchDataDir("");
+ if ( $data_dir->can('initSearchDirectories') ) {
+ # 4.0+
+ $data_dir -> initSearchDirectories("");
+ } else {
+ # pre-4.0
+ $data_dir -> searchDataDir("");
+ }
} else {
$data_dir=undef;
}
if (! exists $config{filetypes_conf}) {
if (! $data_dir ) {
$config{filetypes_conf}= "/etc/highlight/filetypes.conf";
- } elsif ( $data_dir -> can('searchFile') ) {
- # 3.18 +
+ } elsif ( $data_dir -> can('getFiletypesConfPath') ) {
+ # 3.14 +
$config{filetypes_conf}=
- $data_dir -> searchFile("filetypes.conf");
+ $data_dir -> getFiletypesConfPath("filetypes");
} else {
# 3.9 +
$config{filetypes_conf}=
my $gen;
if (! exists $highlighters{$langfile}) {
+ no warnings 'once';
$gen = highlight::CodeGenerator::getInstance($highlight::XHTML);
+ use warnings;
$gen->setFragmentCode(1); # generate html fragment
$gen->setHTMLEnclosePreTag(1); # include stylish <pre>
if ($data_dir){