satoshi-takano / OpenGraph

A Swift wrapper for the Open Graph protocol (OGP).
190 stars 60 forks source link

If the title has an apostrophe it instead shows "&#x27" #58

Closed Spencer-Villarreal closed 1 month ago

Spencer-Villarreal commented 2 years ago

When I am using your pod to fetch the OG tags from a news article that has an apostrophe it shows an error with your method.

Version: 1.4.1 Used cocapods to install Xcode version: 13.2.1 Device: iPhone 12 iOS 15.1

----- Example 1 ----- Should receive: Jim Simons' RenTech fund nearly doubled its AMC stake

What I receive when using your pod: Jim Simons' RenTech fund nearly doubled its AMC stake

https://markets.businessinsider.com/news/stocks/jim-simons-renaissance-technologies-rentech-amc-entertainment-gamestop-tesla-stock-2022-2?amp

----- Example 2 ----- Should receive: Today's Stock Market News & Events: 12/8/2021

What I receive when using your pod: Today's Stock Market News & Events: 12/8/2021

https://www.schaeffersresearch.com/content/news/2021/12/08/todays-stock-market-news-events-12-8-2021

----- Example 3 ----- Should receive: Interest rate hike needed 'shortly' after March

What I receive when using your pod: Interest rate hike needed 'shortly' after March

https://www.marketwatch.com/story/interest-rate-hike-needed-shortly-after-march-end-to-asset-purchases-feds-waller-says-11639764021

Spencer-Villarreal commented 2 years ago

Wow, Github automatically changes the Unicode to the apostrophe. My question may look weird by the main thing is that the apostrophes are still in Unicode

khanlou commented 2 years ago

I was noticing this too — I think this library should probably be the one to handle this conversion, rather than putting it on every caller