diff options
author | Carlos Fenollosa <carlos.fenollosa@gmail.com> | 2014-09-15 19:32:51 +0200 |
---|---|---|
committer | Carlos Fenollosa <carlos.fenollosa@gmail.com> | 2014-09-15 19:32:51 +0200 |
commit | 63476204de94140e21727f906c601a813ab5297b (patch) | |
tree | 7617439f3b15d4db1f7b2fb2e5440136fc695372 | |
parent | adfcd9801259017c5f9e7b9c6fd14589669506b3 (diff) |
properly quote twitter cards
-rwxr-xr-x | bb.sh | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -336,8 +336,8 @@ twitter_card() { echo "<meta name='twitter:card' content='summary' />" echo "<meta name='twitter:site' content='@$global_twitter_username' />" echo "<meta name='twitter:title' content='$2' />" # Twitter truncates at 70 char - description=$(grep -v "^<p>$template_tags_line_header" $1 | sed -e 's/<[^>]*>//g' | head -c 250 | tr '\n' ' ') - echo "<meta name='twitter:description' content='$description' />" + description=$(grep -v "^<p>$template_tags_line_header" $1 | sed -e 's/<[^>]*>//g' | head -c 250 | tr '\n' ' ' | sed "s/\"/'/g") + echo "<meta name='twitter:description' content=\"$description\" />" image=$(sed -n 's/.*<img.*src="\([^"]*\)".*/\1/p' $1 | head -n 1) # First image is fine [[ -z "$image" ]] && return [[ $image =~ ^https?:\/\/ ]] || image="$global_url/$image" # Check that URL is absolute |