diff options
author | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-05-19 21:10:47 -0400 |
---|---|---|
committer | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-05-19 21:10:47 -0400 |
commit | cee7eea4d135fcf773a9f07cfdd7c82e7ab2fcd9 (patch) | |
tree | 533ced9c93adaa4db4e843b1adf17e7a6dbd3e63 | |
parent | 3711e509323b11ebf24f8379c018c9fd30458a8b (diff) |
Preserve whitespace before link text
-rwxr-xr-x | gemini.filter.dpi | 5 |
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 } /^$/ { |