Closed tstaerk closed 1 year ago
I got it fixed with this patch:
echo($match);
53a51 return false; 55a54 return false;
however I do not understand why
and again as a unified patch:
root@mediasyntax-test:/var/www/html/dokuwiki/lib/plugins/mediasyntax/syntax# diff -rup /home/thorsten/mediasyntax/syntax/codeblock.php codeblock.php --- /home/thorsten/mediasyntax/syntax/codeblock.php 2023-07-29 15:36:25.082485463 +0000 +++ codeblock.php 2023-07-29 15:33:45.254580493 +0000 @@ -45,14 +45,13 @@ class syntax_plugin_mediasyntax_codebloc { // $match2 = $match, but cut one blank at the beginning of every line. $match2 = $match;
and again in a codeblock: `root@mediasyntax-test:/var/www/html/dokuwiki/lib/plugins/mediasyntax/syntax# diff -rup /home/thorsten/mediasyntax/syntax/codeblock.php codeblock.php --- /home/thorsten/mediasyntax/syntax/codeblock.php 2023-07-29 15:36:25.082485463 +0000 +++ codeblock.php 2023-07-29 15:33:45.254580493 +0000 @@ -45,14 +45,13 @@ class syntax_plugin_mediasyntax_codebloc { // $match2 = $match, but cut one blank at the beginning of every line. $match2 = $match;
Or easier:
root@mediasyntax-test:/var/www/html/dokuwiki/lib/plugins/mediasyntax/syntax# diff -rup /home/thorsten/mediasyntax/syntax/codeblock.php codeblock.php
--- /home/thorsten/mediasyntax/syntax/codeblock.php 2023-07-29 15:36:25.082485463 +0000
+++ codeblock.php 2023-07-29 15:45:42.610155230 +0000
@@ -44,14 +44,14 @@ class syntax_plugin_mediasyntax_codebloc
function handle($match, $state, $pos, Doku_Handler $handler)
{
// $match2 = $match, but cut one blank at the beginning of every line.
- $match2 = $match;
+ $match2 = "";
for ($i = 1; $i < strlen($match); $i++) {
if ($match[$i - 1] == "\n" && $match[$i] == " ") {;
} else $match2 .= $match[$i];
}
switch ($state) {
case DOKU_LEXER_ENTER:
- return array($state, $match2);
+ return false;
case DOKU_LEXER_MATCHED:
return array($state, $match2);
case DOKU_LEXER_UNMATCHED:
Now I don't understand how it could ever work before.
Code blocks used to work but don't seem to work any longer. Test code:
this is a
pre line
blablabla