site

My personal website.

Date: Sun, 11 Jul 2021 23:52:01 +0200

Fix generation of links

Diffstat:

M generate                            |       5 +++--

1 file changed, 3 insertions(+), 2 deletions(-)

@@ -71,9 +71,10 @@ while read -r file <&4; do
             "=>"*)
                 [ -n "$end" ] && echo "$end"
                 end=""
-                line="$(escape "$line" | cut -c 3- | tr -d '\n')"
-                url="$(escape "$line" | awk '{print $1}')"
+                line="$(printf "%s" "$line" | cut -c 3- | tr -d '\n')"
+                url="$(printf "%s" "$line" | awk '{print $1}')"
                 text="$(escape "$line" | awk '{$1="";print}' | awk '{$1=$1;print}')"
+                line="$(escape "$line")"
                 [ -z "$text" ] && text="$url"
                 if [ $output = "html" ]; then
                     printf "%s\n" "<p><a href=\"$url\">$text</a></p>"