fix missplaced

This commit is contained in:
DeltaLima 2023-06-22 00:10:50 +02:00
parent c2a36e4e6c
commit 888c3ef085

View file

@ -28,7 +28,6 @@ SOFTWARE.
*/ */
$config = include('config.php');
function plugin_syntaxhighlighter_add($lang=null) { function plugin_syntaxhighlighter_add($lang=null) {
static $languages = array(); static $languages = array();
@ -46,6 +45,8 @@ function plugin_syntaxhighlighter_add($lang=null) {
function plugin_syntaxhighlighter_head() { function plugin_syntaxhighlighter_head() {
$config = include('config.php');
$pdir=plugin_geturl('syntaxhighlighter'); $pdir=plugin_geturl('syntaxhighlighter');
echo <<<PRISMJS echo <<<PRISMJS
<!-- start of prism.js header --> <!-- start of prism.js header -->
@ -62,6 +63,7 @@ add_action('wp_head', 'plugin_syntaxhighlighter_head');
function plugin_syntaxhighlighter_foot() { function plugin_syntaxhighlighter_foot() {
$config = include('config.php');
// convert the returned array into a json one, to have an easier time // convert the returned array into a json one, to have an easier time
// giving it to the javascript below // giving it to the javascript below
$used_languages = json_encode(plugin_syntaxhighlighter_add()); $used_languages = json_encode(plugin_syntaxhighlighter_add());
@ -71,7 +73,7 @@ function plugin_syntaxhighlighter_foot() {
echo <<<PRISMBOX echo <<<PRISMBOX
<!-- start of prism.js footer --> <!-- start of prism.js footer -->
<script type="text/javascript" src="{$pdir}res/prism.$config['size'].js"></script> <script type="text/javascript" src="{$pdir}res/prism.{$config['size']}.js"></script>
<!-- include wrapping-function to wrap content of pre html-tags into code-tags, as said in https://prismjs.com/index.html#basic-usage --> <!-- include wrapping-function to wrap content of pre html-tags into code-tags, as said in https://prismjs.com/index.html#basic-usage -->
<script type="text/javascript" src="{$pdir}res/syntaxhighlighter-ng.js"></script> <script type="text/javascript" src="{$pdir}res/syntaxhighlighter-ng.js"></script>