Summary Files Commits Branches @commit @diff @stats
path: root / single.awk
diff options
context:
space:
mode:
Commitcb888c3ddad432a4a66106834d7655592becee3b (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-01-01 14:42:40 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-01-01 14:42:40 +0200
Filesb66caaca43da13807d658a78f297d04850889a24 /single.awk
csg-cb888c3ddad432a4a66106834d7655592becee3b.tar
csg-cb888c3ddad432a4a66106834d7655592becee3b.tar.gz
csg-cb888c3ddad432a4a66106834d7655592becee3b.zip
Parentc898624b54087f482f84c16a44677ab63f842d47 (diff)
fix(single): Open code blocks on the first line, not previous
This doesn't introduce another newline into the codeblock
1 files changed, 5 insertions, 3 deletions
-rw-r--r--single.awk8
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 "<pre><code>"
- inside_codeblock = 1
}
## Autoescape & and <
@@ -254,6 +251,11 @@ list_started && /^\[[x ]\][ \t]/ {
gsub(/</, "\\&lt;")
gsub(/>/, "\\&gt;")
+ if (!inside_codeblock) {
+ $0 = "<pre><code>" $0
+ inside_codeblock = 1
+ }
+
_next()
}