X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ab511bb39c4cde35137b7ce3a2fe34fe720259a5..c037714b77535c849c8d8ef4807af2b59737a5c5:/IkiWiki/Plugin/highlight.pm diff --git a/IkiWiki/Plugin/highlight.pm b/IkiWiki/Plugin/highlight.pm index 65e372db1..fbe7ddff4 100644 --- a/IkiWiki/Plugin/highlight.pm +++ b/IkiWiki/Plugin/highlight.pm @@ -51,13 +51,8 @@ sub getsetup () { } sub checkconfig () { - eval q{use highlight}; - if ($@) { - print STDERR "Failed to load highlight. Configuring anyway.\n"; - }; - - if (highlight::DataDir->can('new')){ + if (highlight::DataDir->can('new')) { $data_dir=new highlight::DataDir(); $data_dir->searchDataDir(""); } else { @@ -94,7 +89,7 @@ sub checkconfig () { id => $file, call => sub { my %params=@_; - highlight($langfile, $params{content}); + highlight($langfile, $file, $params{content}); }, longname => sprintf(gettext("Source code: %s"), $file), @opts, @@ -111,7 +106,7 @@ sub htmlizeformat { return; } - return Encode::decode_utf8(highlight($langfile, shift)); + return Encode::decode_utf8(highlight($langfile, $format, shift)); } my %ext2lang; @@ -177,6 +172,7 @@ sub ext2langfile ($) { # Interface to the highlight C library. sub highlight ($$) { my $langfile=shift; + my $extorfile=shift; my $input=shift; eval q{use highlight}; @@ -205,7 +201,7 @@ sub highlight ($$) { $gen=$highlighters{$langfile}; } - return $gen->generateString($input); + return "