Skip to content

Commit 390fb6f

Browse files
committed
Merge branch 'release/2.0.1'
2 parents 475eb1f + 94215d0 commit 390fb6f

19 files changed

+41
-317
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# v2.0.1
2+
## 12/29/2025
3+
4+
1. [](#bugfix)
5+
* Fix a PSR-Cache compatibility issue
6+
17
# v2.0.0
28
## 12/24/2025
39

blueprints.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Code Syntax Highlighter
22
slug: codesh
33
type: plugin
4-
version: 2.0.0
4+
version: 2.0.1
55
description: Server-side syntax highlighting using Phiki with line numbers, line highlighting, and focus support
66
icon: code
77
author:

codesh.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,10 +1165,8 @@ protected function getPhiki(): Phiki
11651165

11661166
// Register custom grammars from plugin's grammars directory
11671167
$grammarsDir = __DIR__ . '/grammars';
1168-
$this->grav['log']->debug('CodeSh (main): Looking for grammars in ' . $grammarsDir . ' (exists: ' . (is_dir($grammarsDir) ? 'yes' : 'no') . ')');
11691168
if (is_dir($grammarsDir)) {
11701169
$files = glob($grammarsDir . '/*.json');
1171-
$this->grav['log']->debug('CodeSh (main): Found ' . count($files) . ' grammar files');
11721170
foreach ($files as $grammarFile) {
11731171
$this->registerGrammarWithAliases($grammarFile);
11741172
}
@@ -1194,7 +1192,6 @@ protected function getPhiki(): Phiki
11941192
protected function registerGrammarWithAliases(string $grammarFile): void
11951193
{
11961194
$grammarSlug = basename($grammarFile, '.json');
1197-
$this->grav['log']->debug('CodeSh: Registering grammar "' . $grammarSlug . '" from ' . $grammarFile);
11981195
$this->phiki->grammar($grammarSlug, $grammarFile);
11991196

12001197
// Read grammar data for aliases and overrides
@@ -1209,7 +1206,6 @@ protected function registerGrammarWithAliases(string $grammarFile): void
12091206
// Can be specified as "overrides": ["markdown", "md"] in the grammar JSON
12101207
if (isset($data['overrides']) && is_array($data['overrides'])) {
12111208
foreach ($data['overrides'] as $override) {
1212-
$this->grav['log']->debug('CodeSh: Overriding grammar "' . $override . '" with ' . $grammarSlug);
12131209
$this->phiki->grammar($override, $grammarFile);
12141210
}
12151211
}
@@ -1222,7 +1218,6 @@ protected function registerGrammarWithAliases(string $grammarFile): void
12221218
foreach ($data['fileTypes'] as $alias) {
12231219
// Skip if alias is same as slug or is protected
12241220
if ($alias !== $grammarSlug && !in_array($alias, $protected)) {
1225-
$this->grav['log']->debug('CodeSh: Registering grammar alias "' . $alias . '" for ' . $grammarSlug);
12261221
$this->phiki->grammar($alias, $grammarFile);
12271222
}
12281223
}
@@ -1238,21 +1233,18 @@ public function onOutputGenerated(): void
12381233

12391234
// Check if markdown processing is enabled
12401235
if (!($config['process_markdown'] ?? true)) {
1241-
$this->grav['log']->debug('CodeSh: process_markdown is disabled, skipping');
12421236
return;
12431237
}
12441238

12451239
// Get the final HTML output
12461240
$output = $this->grav->output;
12471241

12481242
if (empty($output)) {
1249-
$this->grav['log']->debug('CodeSh: Output is empty, skipping');
12501243
return;
12511244
}
12521245

12531246
// Count unprocessed code blocks
12541247
$hasUnprocessedBlocks = preg_match_all('/<pre><code[^>]*>/', $output, $matches);
1255-
$this->grav['log']->debug('CodeSh: Found ' . $hasUnprocessedBlocks . ' potential code blocks in output');
12561248

12571249
// Skip if no code blocks
12581250
if ($hasUnprocessedBlocks === 0) {
@@ -1266,12 +1258,9 @@ public function onOutputGenerated(): void
12661258
$output = preg_replace_callback(
12671259
'/<pre><code class="language-([^"]+)">(.*?)<\/code><\/pre>/s',
12681260
function ($matches) use ($config, &$replacementCount) {
1269-
$fullMatch = $matches[0];
12701261
$lang = $matches[1];
12711262
$code = $matches[2];
12721263

1273-
$this->grav['log']->debug('CodeSh: Processing code block with lang="' . $lang . '"');
1274-
12751264
// Decode HTML entities back to original code
12761265
$code = html_entity_decode($code, ENT_QUOTES | ENT_HTML5, 'UTF-8');
12771266

@@ -1287,8 +1276,6 @@ function ($matches) use ($config, &$replacementCount) {
12871276
function ($matches) use ($config, &$replacementCount) {
12881277
$code = $matches[1];
12891278

1290-
$this->grav['log']->debug('CodeSh: Processing code block without lang');
1291-
12921279
// Decode HTML entities back to original code
12931280
$code = html_entity_decode($code, ENT_QUOTES | ENT_HTML5, 'UTF-8');
12941281

@@ -1298,8 +1285,6 @@ function ($matches) use ($config, &$replacementCount) {
12981285
$output
12991286
);
13001287

1301-
$this->grav['log']->debug('CodeSh: Replaced ' . $replacementCount . ' code blocks');
1302-
13031288
// Update the output
13041289
$this->grav->output = $output;
13051290
}
@@ -1309,9 +1294,6 @@ function ($matches) use ($config, &$replacementCount) {
13091294
*/
13101295
protected function highlightCode(string $code, string $lang, array $config): string
13111296
{
1312-
// Debug: Log the lang being requested
1313-
$this->grav['log']->debug('CodeSh (main): highlightCode() called with lang="' . $lang . '", content_len=' . strlen($code));
1314-
13151297
// Detect theme mode from Helios theme config
13161298
$themeConfig = $this->config->get('themes.helios.appearance.theme', 'system');
13171299

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"php": ">=8.1",
88
"phiki/phiki": "^2.0"
99
},
10+
"replace": {
11+
"psr/simple-cache": "*"
12+
},
1013
"autoload": {
1114
"psr-4": {
1215
"Grav\\Plugin\\": "",

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919

2020
require_once __DIR__ . '/composer/autoload_real.php';
2121

22-
return ComposerAutoloaderInit81b766219681030a1ba9c1169eaefb32::getLoader();
22+
return ComposerAutoloaderInit90e01fb61f1aca7f9b8ddcbd103d5a2a::getLoader();

vendor/composer/autoload_psr4.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
return array(
99
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
10-
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
1110
'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'),
1211
'Phiki\\' => array($vendorDir . '/phiki/phiki/src'),
1312
'Nette\\' => array($vendorDir . '/nette/schema/src', $vendorDir . '/nette/utils/src'),

vendor/composer/autoload_real.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInit81b766219681030a1ba9c1169eaefb32
5+
class ComposerAutoloaderInit90e01fb61f1aca7f9b8ddcbd103d5a2a
66
{
77
private static $loader;
88

@@ -24,16 +24,16 @@ public static function getLoader()
2424

2525
require __DIR__ . '/platform_check.php';
2626

27-
spl_autoload_register(array('ComposerAutoloaderInit81b766219681030a1ba9c1169eaefb32', 'loadClassLoader'), true, true);
27+
spl_autoload_register(array('ComposerAutoloaderInit90e01fb61f1aca7f9b8ddcbd103d5a2a', 'loadClassLoader'), true, true);
2828
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29-
spl_autoload_unregister(array('ComposerAutoloaderInit81b766219681030a1ba9c1169eaefb32', 'loadClassLoader'));
29+
spl_autoload_unregister(array('ComposerAutoloaderInit90e01fb61f1aca7f9b8ddcbd103d5a2a', 'loadClassLoader'));
3030

3131
require __DIR__ . '/autoload_static.php';
32-
call_user_func(\Composer\Autoload\ComposerStaticInit81b766219681030a1ba9c1169eaefb32::getInitializer($loader));
32+
call_user_func(\Composer\Autoload\ComposerStaticInit90e01fb61f1aca7f9b8ddcbd103d5a2a::getInitializer($loader));
3333

3434
$loader->register(true);
3535

36-
$filesToLoad = \Composer\Autoload\ComposerStaticInit81b766219681030a1ba9c1169eaefb32::$files;
36+
$filesToLoad = \Composer\Autoload\ComposerStaticInit90e01fb61f1aca7f9b8ddcbd103d5a2a::$files;
3737
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
3838
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
3939
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

vendor/composer/autoload_static.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Composer\Autoload;
66

7-
class ComposerStaticInit81b766219681030a1ba9c1169eaefb32
7+
class ComposerStaticInit90e01fb61f1aca7f9b8ddcbd103d5a2a
88
{
99
public static $files = array (
1010
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
@@ -18,7 +18,6 @@ class ComposerStaticInit81b766219681030a1ba9c1169eaefb32
1818
),
1919
'P' =>
2020
array (
21-
'Psr\\SimpleCache\\' => 16,
2221
'Psr\\EventDispatcher\\' => 20,
2322
'Phiki\\' => 6,
2423
),
@@ -47,10 +46,6 @@ class ComposerStaticInit81b766219681030a1ba9c1169eaefb32
4746
array (
4847
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
4948
),
50-
'Psr\\SimpleCache\\' =>
51-
array (
52-
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
53-
),
5449
'Psr\\EventDispatcher\\' =>
5550
array (
5651
0 => __DIR__ . '/..' . '/psr/event-dispatcher/src',
@@ -160,9 +155,9 @@ class ComposerStaticInit81b766219681030a1ba9c1169eaefb32
160155
public static function getInitializer(ClassLoader $loader)
161156
{
162157
return \Closure::bind(function () use ($loader) {
163-
$loader->prefixLengthsPsr4 = ComposerStaticInit81b766219681030a1ba9c1169eaefb32::$prefixLengthsPsr4;
164-
$loader->prefixDirsPsr4 = ComposerStaticInit81b766219681030a1ba9c1169eaefb32::$prefixDirsPsr4;
165-
$loader->classMap = ComposerStaticInit81b766219681030a1ba9c1169eaefb32::$classMap;
158+
$loader->prefixLengthsPsr4 = ComposerStaticInit90e01fb61f1aca7f9b8ddcbd103d5a2a::$prefixLengthsPsr4;
159+
$loader->prefixDirsPsr4 = ComposerStaticInit90e01fb61f1aca7f9b8ddcbd103d5a2a::$prefixDirsPsr4;
160+
$loader->classMap = ComposerStaticInit90e01fb61f1aca7f9b8ddcbd103d5a2a::$classMap;
166161

167162
}, null, ClassLoader::class);
168163
}

vendor/composer/installed.json

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -343,17 +343,17 @@
343343
},
344344
{
345345
"name": "nette/utils",
346-
"version": "v4.1.0",
347-
"version_normalized": "4.1.0.0",
346+
"version": "v4.1.1",
347+
"version_normalized": "4.1.1.0",
348348
"source": {
349349
"type": "git",
350350
"url": "https://github.com/nette/utils.git",
351-
"reference": "fa1f0b8261ed150447979eb22e373b7b7ad5a8e0"
351+
"reference": "c99059c0315591f1a0db7ad6002000288ab8dc72"
352352
},
353353
"dist": {
354354
"type": "zip",
355-
"url": "https://api.github.com/repos/nette/utils/zipball/fa1f0b8261ed150447979eb22e373b7b7ad5a8e0",
356-
"reference": "fa1f0b8261ed150447979eb22e373b7b7ad5a8e0",
355+
"url": "https://api.github.com/repos/nette/utils/zipball/c99059c0315591f1a0db7ad6002000288ab8dc72",
356+
"reference": "c99059c0315591f1a0db7ad6002000288ab8dc72",
357357
"shasum": ""
358358
},
359359
"require": {
@@ -377,7 +377,7 @@
377377
"ext-mbstring": "to use Strings::lower() etc...",
378378
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
379379
},
380-
"time": "2025-12-01T17:49:23+00:00",
380+
"time": "2025-12-22T12:14:32+00:00",
381381
"type": "library",
382382
"extra": {
383383
"branch-alias": {
@@ -429,7 +429,7 @@
429429
],
430430
"support": {
431431
"issues": "https://github.com/nette/utils/issues",
432-
"source": "https://github.com/nette/utils/tree/v4.1.0"
432+
"source": "https://github.com/nette/utils/tree/v4.1.1"
433433
},
434434
"install-path": "../nette/utils"
435435
},
@@ -560,60 +560,6 @@
560560
},
561561
"install-path": "../psr/event-dispatcher"
562562
},
563-
{
564-
"name": "psr/simple-cache",
565-
"version": "3.0.0",
566-
"version_normalized": "3.0.0.0",
567-
"source": {
568-
"type": "git",
569-
"url": "https://github.com/php-fig/simple-cache.git",
570-
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
571-
},
572-
"dist": {
573-
"type": "zip",
574-
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
575-
"reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
576-
"shasum": ""
577-
},
578-
"require": {
579-
"php": ">=8.0.0"
580-
},
581-
"time": "2021-10-29T13:26:27+00:00",
582-
"type": "library",
583-
"extra": {
584-
"branch-alias": {
585-
"dev-master": "3.0.x-dev"
586-
}
587-
},
588-
"installation-source": "dist",
589-
"autoload": {
590-
"psr-4": {
591-
"Psr\\SimpleCache\\": "src/"
592-
}
593-
},
594-
"notification-url": "https://packagist.org/downloads/",
595-
"license": [
596-
"MIT"
597-
],
598-
"authors": [
599-
{
600-
"name": "PHP-FIG",
601-
"homepage": "https://www.php-fig.org/"
602-
}
603-
],
604-
"description": "Common interfaces for simple caching",
605-
"keywords": [
606-
"cache",
607-
"caching",
608-
"psr",
609-
"psr-16",
610-
"simple-cache"
611-
],
612-
"support": {
613-
"source": "https://github.com/php-fig/simple-cache/tree/3.0.0"
614-
},
615-
"install-path": "../psr/simple-cache"
616-
},
617563
{
618564
"name": "symfony/deprecation-contracts",
619565
"version": "v3.6.0",

vendor/composer/installed.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php return array(
22
'root' => array(
33
'name' => 'getgrav/codesh',
4-
'pretty_version' => 'dev-main',
5-
'version' => 'dev-main',
6-
'reference' => '4592e339bc8486e8deff76cefc36459ab11bcf10',
4+
'pretty_version' => 'dev-develop',
5+
'version' => 'dev-develop',
6+
'reference' => '7682a72c65e684f56dce6a0c6901cf16be7afe09',
77
'type' => 'grav-plugin',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -20,9 +20,9 @@
2020
'dev_requirement' => false,
2121
),
2222
'getgrav/codesh' => array(
23-
'pretty_version' => 'dev-main',
24-
'version' => 'dev-main',
25-
'reference' => '4592e339bc8486e8deff76cefc36459ab11bcf10',
23+
'pretty_version' => 'dev-develop',
24+
'version' => 'dev-develop',
25+
'reference' => '7682a72c65e684f56dce6a0c6901cf16be7afe09',
2626
'type' => 'grav-plugin',
2727
'install_path' => __DIR__ . '/../../',
2828
'aliases' => array(),
@@ -56,9 +56,9 @@
5656
'dev_requirement' => false,
5757
),
5858
'nette/utils' => array(
59-
'pretty_version' => 'v4.1.0',
60-
'version' => '4.1.0.0',
61-
'reference' => 'fa1f0b8261ed150447979eb22e373b7b7ad5a8e0',
59+
'pretty_version' => 'v4.1.1',
60+
'version' => '4.1.1.0',
61+
'reference' => 'c99059c0315591f1a0db7ad6002000288ab8dc72',
6262
'type' => 'library',
6363
'install_path' => __DIR__ . '/../nette/utils',
6464
'aliases' => array(),
@@ -83,13 +83,10 @@
8383
'dev_requirement' => false,
8484
),
8585
'psr/simple-cache' => array(
86-
'pretty_version' => '3.0.0',
87-
'version' => '3.0.0.0',
88-
'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
89-
'type' => 'library',
90-
'install_path' => __DIR__ . '/../psr/simple-cache',
91-
'aliases' => array(),
9286
'dev_requirement' => false,
87+
'replaced' => array(
88+
0 => '*',
89+
),
9390
),
9491
'symfony/deprecation-contracts' => array(
9592
'pretty_version' => 'v3.6.0',

0 commit comments

Comments
 (0)