From 6b9ba3a59a802c37d651c9a19218a0a57492e96b Mon Sep 17 00:00:00 2001 From: rf Date: Sat, 24 Sep 2022 21:59:55 -0500 Subject: [PATCH] fix bash --- insert-posts.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/insert-posts.sh b/insert-posts.sh index 71d3f70..436bd53 100755 --- a/insert-posts.sh +++ b/insert-posts.sh @@ -66,8 +66,12 @@ for file in $(ls "$BLOG_DIR/posts"); do slug=$(sed -n '2p' $target_file | tr -d '\n') title=$(sed -n '3p' $target_file | tr -d '\n') content=$(sed -n '4,$p' $target_file | tr -d '\n') - # Cool little sed to escape html - content=$(sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g' "$content") + + content=${1//&/&} + content=${s///>} + content=${s//'"'/"} + content=${s//"'"/‘} insert_post "$date" "$slug" "$title" "$content" done