X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cf3e3c5a8849dcf7f43d055bb9555e088651bae4..6c546c8f3182668c6d21d578b789674894f18c39:/IkiWiki/Plugin/highlight.pm diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm index ce919748a..c974db562 100644 --- a/IkiWiki/Plugin/highlight.pm +++ b/IkiWiki/Plugin/highlight.pm @@ -54,7 +54,13 @@ sub checkconfig () { 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; } @@ -62,10 +68,10 @@ sub checkconfig () { 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}= @@ -201,7 +207,9 @@ sub highlight ($$) { 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
if ($data_dir){