From 031c75b530ffb40a4e567c635574563cba5a9122 Mon Sep 17 00:00:00 2001 From: trendschau Date: Thu, 28 Nov 2024 22:55:52 +0100 Subject: [PATCH] V2.12.0 fix empty lines after codeblocks --- system/typemill/Extensions/ParsedownExtension.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/system/typemill/Extensions/ParsedownExtension.php b/system/typemill/Extensions/ParsedownExtension.php index 410e5f3..10e5e01 100644 --- a/system/typemill/Extensions/ParsedownExtension.php +++ b/system/typemill/Extensions/ParsedownExtension.php @@ -1104,7 +1104,10 @@ class ParsedownExtension extends \ParsedownExtra # keep empty lines in pre-tags if($CurrentBlock['type'] == 'FencedCode' && isset($current['text'])) { - $current['text'] .= "\n"; + # Append a newline only if it's not the last blank line in the block + if (empty($CurrentBlock['complete'])) { + $current['text'] .= "\n"; + } } continue; }