sbs

A Simple Blogging System.
git clone https://git.sr.ht/~jbauer/sbs
Log | Files | Refs | README | LICENSE

commit 3e841adac8c53a01d3fd4c1293929429ea2c18c6
parent 748af06ed50f265b21b126deb89b04d58a062363
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Fri, 19 Aug 2022 15:15:38 -0400

Support arbitrary number of spaces in Gemini link format

According to the gemtext specification, it's completely fine for there
to be zero or any number of spaces between the '=>' that denotes a link
and the following URL. This change allows that, instead of assuming
there will always be just one space after the '=>'.

Diffstat:
Msbs | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbs b/sbs @@ -161,8 +161,8 @@ build() if [ "$(echo "$file" | awk -F\. '{print $NF}' )" = "gmi" ]; then printf "Converting: %s to markdown...\n" "$file" fileName=$(basename "$file" .gmi) - sed -e 's/\(=> \)\(.*\)\(.gmi\)\(.*\)/\1\2.html\4/g' \ - -e 's/=> \([^ ]*\)\( \|\)\(.*\)/[\3](\1)\n/g' \ + sed -e 's/\(=>[ ]*\)\(.*\)\(.gmi\)\(.*\)/\1\2.html\4/g' \ + -e 's/=>[ ]*\([^ ]*\)\( \|\)\(.*\)/[\3](\1)\n/g' \ -e 's/\[\](\(.*\))/[\1](\1)/g' \ "$file" > /tmp/sbs/"$fileName".md title=$(grep '^# ' "$file" | head -n1 | cut -d' ' -f2-)