From c898624b54087f482f84c16a44677ab63f842d47 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 1 Jan 2025 14:40:19 +0200 Subject: fix(single): Move code blocks closing above lists Fixes issues with code blocks inside lists --- single.awk | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'single.awk') diff --git a/single.awk b/single.awk index 2a92373..60e32ae 100644 --- a/single.awk +++ b/single.awk @@ -155,6 +155,14 @@ blockquote_level > 0 && empty0 { } /^>$/ { $0 = ""; not_paragraph = 1 } +# Code blocks (ending) +inside_codeblock && ! /^[ \t]*$)/ { + PNappnd("") + inside_codeblock = 0 + emptyP1 = 1 + not_paragraph = 1 +} + # Lists function end_list() { if (list_level == 0) return @@ -248,11 +256,6 @@ list_started && /^\[[x ]\][ \t]/ { _next() } -inside_codeblock && ! /^[ \t]*$/ { - PNappnd("") - inside_codeblock = 0 - emptyP1 = 1 -} # Automatic links /<[^ \t<>]+>/ { -- cgit v1.3.1-23-gd82d