Skip to content

Commit

Permalink
Fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jDanek committed Sep 23, 2023
1 parent 4fece8c commit aa6d882
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plugins/extend/highlighter/event/head_assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
return function (array $args) {
global $_index, $_page;

$config = $this->getConfig();

if (
(
$_index->type === WebState::PAGE
&& isset(Page::TYPES[$_page['type']])
&& $this->getConfig()['in_' . Page::TYPES[$_page['type']]]
&& isset($config['in_' . Page::TYPES[$_page['type']]])
&& $config['in_' . Page::TYPES[$_page['type']]]
)
|| ($_index->type === WebState::PLUGIN && $this->getConfig()['in_plugin'])
|| ($_index->type === WebState::MODULE && $this->getConfig()['in_module'])
|| ($_index->type === WebState::PLUGIN && $config['in_plugin'])
|| ($_index->type === WebState::MODULE && $config['in_module'])
) {
$args['css'][] = $this->getAssetPath('public/styles/' . $this->getConfig()['style'] . '.css');
$args['css'][] = $this->getAssetPath('public/styles/' . $config['style'] . '.css');
$args['js'][] = $this->getAssetPath('public/highlight.pack.js');
$args['js_after'] .= "\n<script>$(document).ready(function(){ $('span.pre').each(function(i, block) {hljs.highlightBlock(block);});});</script>";
}
Expand Down

0 comments on commit aa6d882

Please sign in to comment.