aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-19 21:10:47 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-19 21:10:47 -0400
commitcee7eea4d135fcf773a9f07cfdd7c82e7ab2fcd9 (patch)
tree533ced9c93adaa4db4e843b1adf17e7a6dbd3e63
parent3711e509323b11ebf24f8379c018c9fd30458a8b (diff)
Preserve whitespace before link text
-rwxr-xr-xgemini.filter.dpi5
1 files changed, 4 insertions, 1 deletions
diff --git a/gemini.filter.dpi b/gemini.filter.dpi
index 2fc7d64..c64ca9e 100755
--- a/gemini.filter.dpi
+++ b/gemini.filter.dpi
@@ -83,9 +83,12 @@ render_gemini() {
text = substr(href, RLENGTH+2)
href = substr(href, 0, RLENGTH)
}
+ match(text, /^\s+/)
+ prefix = substr(text, 0, RLENGTH)
+ text = substr(text, RLENGTH+1)
sub(/:1965/, "", href)
html = escape_html(text)
- printf "<div><a href=\"%s\">%s</a></div>\n", href, html
+ printf "<div>%s<a href=\"%s\">%s</a></div>\n", prefix, href, html
next
}
/^$/ {