From cb888c3ddad432a4a66106834d7655592becee3b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 1 Jan 2025 14:42:40 +0200 Subject: fix(single): Open code blocks on the first line, not previous This doesn't introduce another newline into the codeblock --- single.awk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'single.awk') diff --git a/single.awk b/single.awk index 60e32ae..0752b9f 100644 --- a/single.awk +++ b/single.awk @@ -241,9 +241,6 @@ list_started && /^\[[x ]\][ \t]/ { # Code blocks /^( |\t)/ { - if (!inside_codeblock) { - P1 = P1 "
"
-		inside_codeblock = 1
 	}
 
 	## Autoescape & and <
@@ -254,6 +251,11 @@ list_started && /^\[[x ]\][ \t]/ {
 	gsub(//, "\\>")
 
+	if (!inside_codeblock) {
+		$0 = "
" $0
+		inside_codeblock = 1
+	}
+
 	_next()
 }
 
-- 
cgit v1.3.1-26-gb76a