From: Amitai Schleier Date: Fri, 14 May 2021 06:46:53 +0000 (+0200) Subject: Catch up to highlight 4.0 API change. X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/9ea3f9dfe7c0341f4e002b48728b8139293e19d0 Catch up to highlight 4.0 API change. In 4.0, searchDataDir() is gone, replaced by initSearchDirectories(). Call the latter if available, else fall back to the former. --- diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm index 04c554ac4..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; }