]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Catch up to highlight 4.0 API change.
authorAmitai Schleier <schmonz-web-ikiwiki@schmonz.com>
Fri, 14 May 2021 06:46:53 +0000 (08:46 +0200)
committerAmitai Schleier <schmonz-web-ikiwiki@schmonz.com>
Fri, 14 May 2021 06:46:53 +0000 (08:46 +0200)
In 4.0, searchDataDir() is gone, replaced by initSearchDirectories().
Call the latter if available, else fall back to the former.

IkiWiki/Plugin/highlight.pm

index 04c554ac4e8da12399e5421eb9293d9c8e7eb866..c974db56227d67da0fb1f99b00d2fbad4a0ba2ef 100644 (file)
@@ -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;
        }