From 9ea3f9dfe7c0341f4e002b48728b8139293e19d0 Mon Sep 17 00:00:00 2001 From: Amitai Schleier Date: Fri, 14 May 2021 08:46:53 +0200 Subject: [PATCH] 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. --- IkiWiki/Plugin/highlight.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; }