From 3ffac7c2545544f1ebcf668ca559df974ea89e8d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 1 Jan 2025 10:42:03 +0200 Subject: chore(single): Move append to nonempty P in a function This will be useful for lists --- single.awk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/single.awk b/single.awk index 5608522..e7d55e4 100644 --- a/single.awk +++ b/single.awk @@ -50,6 +50,11 @@ function empty(value) { return value == "" } +function PNappnd(value) { + if (emptyP1) P2 = P2 ORS value + else P1 = P1 ORS value +} + function _next() { __buffered_print() not_paragraph = 1 @@ -172,12 +177,7 @@ blockquote_level > 0 && empty0 { _next() } inside_codeblock && ! /^[ \t]*$/ { - if (emptyP1) { - P2 = P2 ORS "" - } - else { - P1 = P1 ORS "" - } + PNappnd("") inside_codeblock = 0 emptyP1 = 1 } -- cgit v1.3.1-23-gd82d