ladybug-podcast / ladybugpodcast

The site for our show!
MIT License
74 stars 19 forks source link

Escape special characters on the title for twitter sharing #69

Closed runningdeveloper closed 4 years ago

runningdeveloper commented 4 years ago

Hi, in the last episode https://ladybug.dev/episode/javascript-frameworks/ when I click the twitter share button it cuts off the title because of the '&' characters in the title of this episode. See image below.

image

I added this encodeURIComponent(shareTitle) function to change the characters to the correct url friendly values. Initially I thought shareTitle.replace(/&/g,'%26') would be fine but what about other characters in titles like hash tags and etc.

After the fix

image