X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9be3f951166e5d1256a806a8db25b7c5c7021acb..5d33421d44e2ca92fcd9f1f2b0212504c9a9cc5f:/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){