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