From 82d3342ab30452f1651fbd10ba8de029b16d62a8 Mon Sep 17 00:00:00 2001 From: Christopher Gurnee Date: Sat, 11 Dec 2021 12:41:39 -0500 Subject: [PATCH] Fix parsing of html entities --- src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index 36f50fc..8956be1 100644 --- a/src/utils.js +++ b/src/utils.js @@ -36,8 +36,8 @@ export const isRemoved = textBody => textBody === '\\[removed\\]' || textBody == // Default thumbnails for reddit threads export const redditThumbnails = ['self', 'default', 'image', 'nsfw'] -// Parse comments -export const parse = text => markdown.render(text) +// Parse comments (see https://www.reddit.com/dev/api/#response_body_encoding) +export const parse = text => markdown.render(text.replaceAll('<', '<').replaceAll('>', '>').replaceAll('&', '&')) // UTC to "Reddit time format" (e.g. 5 hours ago, just now, etc...) export const prettyDate = createdUTC => {