1
0

Fix: Last line of code block was wrong

This commit is contained in:
Richard Dern 2024-04-21 23:45:09 +02:00
parent 8fb6672ef9
commit 772af16752

View File

@ -187,6 +187,10 @@ private function formatCodeBlock(string $block): string
$lines[0] = preg_replace('/^(```\w*)\s*{.*?}$/', '$1', trim($lines[0]));
}
$last = count($lines) - 1;
$lines[$last] = '```';
// Reassemble the block
return implode("\n", $lines);
}