From 6641b7c63c132140d9ead467e36726917d29d284 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Thu, 16 Nov 2023 18:03:31 -0600 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20print=20santized=20escape=20cod?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sfeed_mastodon | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sfeed_mastodon b/sfeed_mastodon index 35bcb6f..ab1b84a 100755 --- a/sfeed_mastodon +++ b/sfeed_mastodon @@ -69,16 +69,18 @@ sfeed_post_text() { local unix_date="$(echo "$line" | awk --field-separator '\t' '{print $1}')" local title="$(echo "$line" | awk --field-separator '\t' '{print $2}')" local url="$(echo "$line" | awk --field-separator '\t' '{print $3}' | url_deescape)" - local desc="$(echo "$line" | awk --field-separator '\t' '{print $4}' | tr -d '\n')" + local desc="$(echo "$line" | awk --field-separator '\t' '{print $4}')" local desc_snip="$(echo "$desc" | head -c250)[…]" printf "$TEMPLATE" \ - | tr -d '|' \ - | sed "s|{{title}}|$title|g" \ - | sed "s|{{unix_date}}|$unix_date|g" \ - | sed "s|{{url}}|$url|g" \ - | sed "s|{{desc}}|$desc|g" \ - | sed "s|{{desc_short}}|$desc_snip|g" + | tr -d '|' \ + | sed "s|{{title}}|$title|g" \ + | sed "s|{{unix_date}}|$unix_date|g" \ + | sed "s|{{url}}|$url|g" \ + | sed "s|{{desc}}|$desc|g" \ + | sed "s|{{desc_short}}|$desc_snip|g" \ + | sed 's%\\n%%' \ + | tr -d ' \n' } @@ -132,6 +134,6 @@ fi IFS=" " -while read line; do +while read -r line; do post_sfeed_line "$SERVER_URL" "$FEDI_AUTH" "$line" done