Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
Commitc898624b54087f482f84c16a44677ab63f842d47 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-01-01 14:40:19 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-01-01 14:40:19 +0200
Files34039b8978d1b4bd1515bca08098957cbef3e2c6 /single.awk
csg-c898624b54087f482f84c16a44677ab63f842d47.tar
csg-c898624b54087f482f84c16a44677ab63f842d47.tar.gz
csg-c898624b54087f482f84c16a44677ab63f842d47.zip
Parent71fd4ce667980be72f7c8f9265ccb345ceb37f6a (diff)
fix(single): Move code blocks closing above lists
Fixes issues with code blocks inside lists
1 files changed, 8 insertions, 5 deletions
-rw-r--r--single.awk13
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("</code></pre>")
+ 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("</code></pre>")
- inside_codeblock = 0
- emptyP1 = 1
-}
# Automatic links
/<[^ \t<>]+>/ {