Closed naafiyan closed 2 years ago
Not completely sure what is causing this as of right now, but it appears that the JSON that is sent from the frontend to the backend still uses apostrophes, but when the backend gets the record back from the database, the special symbols are gone. This could be a database formatting issue, or it could be something else that we can just change the way the text is rendered on the frontend.
It seems that the culprit is express validators, which are changing some characters to their HTML counterparts when using .escape()
sanitizer. We can either run .unescape()
on the GET requests to undo this action when getting things back from the DB, or does mongo even require doing this (does Mongoose or even the DB handle this ok)
Removed .escape()
sanitizers, which are not necessary when using mongoose
HTML encoding issue. The ' is showing up as ' Most likely an issue with other symbols too.