@@ -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
0 commit comments