From a61fadac109c1be7f5b33a54db139576de4faad3 Mon Sep 17 00:00:00 2001 From: julianharty Date: Fri, 26 Jan 2024 13:31:31 +0000 Subject: [PATCH] Minor edits so the script runs in php v8.0 --- markdown/markdown.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/markdown/markdown.php b/markdown/markdown.php index 8b7a8e8..0dfffca 100755 --- a/markdown/markdown.php +++ b/markdown/markdown.php @@ -911,7 +911,7 @@ function _doHeaders_callback_setext($matches) { if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) return $matches[0]; - $level = $matches[2]{0} == '=' ? 1 : 2; + $level = $matches[2][0] == '=' ? 1 : 2; $block = "".$this->runSpanGamut($matches[1]).""; return "\n" . $this->hashBlock($block) . "\n\n"; } @@ -1198,7 +1198,7 @@ function doItalicsAndBold($text) { } else { # Other closing marker: close one em or strong and # change current token state to match the other - $token_stack[0] = str_repeat($token{0}, 3-$token_len); + $token_stack[0] = str_repeat($token[0], 3-$token_len); $tag = $token_len == 2 ? "strong" : "em"; $span = $text_stack[0]; $span = $this->runSpanGamut($span); @@ -1223,7 +1223,7 @@ function doItalicsAndBold($text) { } else { # Reached opening three-char emphasis marker. Push on token # stack; will be handled by the special condition above. - $em = $token{0}; + $em = $token[0]; $strong = "$em$em"; array_unshift($token_stack, $token); array_unshift($text_stack, ''); @@ -1544,9 +1544,9 @@ function handleSpanToken($token, &$str) { # Handle $token provided by parseSpan by determining its nature and # returning the corresponding value that should replace it. # - switch ($token{0}) { + switch ($token[0]) { case "\\": - return $this->hashPart("&#". ord($token{1}). ";"); + return $this->hashPart("&#". ord($token[1]). ";"); case "`": # Search for end marker in remaining text. if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm',