]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/highlight.pm
link to the actual ikiwiki repo
[git.ikiwiki.info.git] / IkiWiki / Plugin / highlight.pm
index ce919748a4d10c6308cea7c1ea6559c47c608534..04c554ac4e8da12399e5421eb9293d9c8e7eb866 100644 (file)
@@ -62,10 +62,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 +201,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 <pre>
                if ($data_dir){