huacnlee / social-share-button

Helper for add social share feature in your Rails app. Twitter, Facebook, Weibo, Douban ...
MIT License
582 stars 309 forks source link

Fixed quote breaking facebook share #158

Closed FrankelJb closed 4 years ago

jasonfb commented 6 years ago

this seem inconsistent with note left on README here: https://github.com/huacnlee/social-share-button#facebook-needs-the-description-added

we were assuming the requirement is on Facebook's end? this code assumes this is not true and FB does not require the description

jasonfb commented 6 years ago

a few observations indicate to us that this code change is correct and the note on the README is wrong, perhaps the only problem is when #{desc} is an empty string

to preserve the existing functionality maybe something like this

http://www.facebook.com/sharer/sharer.php?u=#{url}&display=popup#{("&quote=" + desc) if desc}
anna-kalina commented 5 years ago

It work's fine without extra space. Does it affect any other shares? desc = encodeURIComponent($parent.data("desc") || '')

Federico-G commented 5 years ago

Any news about this?