Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
Commit3ffac7c2545544f1ebcf668ca559df974ea89e8d (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-01-01 10:42:03 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-01-01 10:42:03 +0200
Files9c3d1522274115d5ebc95206f1213f961806d369 /single.awk
csg-3ffac7c2545544f1ebcf668ca559df974ea89e8d.tar
csg-3ffac7c2545544f1ebcf668ca559df974ea89e8d.tar.gz
csg-3ffac7c2545544f1ebcf668ca559df974ea89e8d.zip
Parent56e895fe4c5d19ccc4d65e5671358ce8e04a0380 (diff)
chore(single): Move append to nonempty P in a function
This will be useful for lists
1 files changed, 6 insertions, 6 deletions
-rw-r--r--single.awk12
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 "</code></pre>"
- }
- else {
- P1 = P1 ORS "</code></pre>"
- }
+ PNappnd("</code></pre>")
inside_codeblock = 0
emptyP1 = 1
}