seanmturley / natureddit

A simple Reddit client, featuring a landing page dedicated to nature with posts pulled from a curated list of subreddits.
0 stars 1 forks source link

Decode HTML special characters in post titles #161

Closed seanmturley closed 7 months ago

seanmturley commented 7 months ago

Description

Some post titles contain HTML special characters which are not currently being decoded e.g.:

Approach

It looks like the best approach is to use the DOMParser API (as described on StackOverflow). Importantly, this approach avoids creating a vulnerability to Cross-Site Scripting.

seanmturley commented 7 months ago

This should now be fixed, though I should keep an eye out for similar issues in other fields beyond the title.