Gapminder / tools-page

Gapminder tools page vanilla
8 stars 5 forks source link

Handle urlencoding #28

Closed jheeffer closed 3 years ago

jheeffer commented 6 years ago

User issue: https://getsatisfaction.com/gapminder/topics/only-blank-box-showing-in-embedded-version-of-bubble-graph

Some CMS url encodes hash of url, e.g. $ => %24, and tools page can't parse the encoded hash. Thus blank page is shown.

We can prevent this error from happening by url decoding the hash before processing it (using decodeURIComponent(). Not sure if that might break something. For example when there's a %xx string that shouldn't be decoded...

Also, we should probably have a more graceful degradation when hash is not parsable.

angiehjort commented 3 years ago

fixes

b368bde5a475a3c482d9553bf6879ddffacd7a6f and 2306c586f6cff3ecca4b1b8a2a0cdb0690069c34