unescape html entities from stackoverflow api response

Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
Brian Fletcher
2022-08-22 20:00:10 +01:00
parent dd9025fe0f
commit a720c44070
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-stack-overflow': patch
---
Unescape html entity references from the stackoverflow API response before rendering the question title to the list component.
@@ -26,6 +26,7 @@ import {
} from '@material-ui/core';
import OpenInNewIcon from '@material-ui/icons/OpenInNew';
import useAsync from 'react-use/lib/useAsync';
import _unescape from 'lodash/unescape';
import qs from 'qs';
import React from 'react';
import {
@@ -73,7 +74,7 @@ export const Content = (props: StackOverflowQuestionsContentProps) => {
<ListItem key={question.link}>
{props.icon && <ListItemIcon>{props.icon}</ListItemIcon>}
<ListItemText
primary={question.title}
primary={_unescape(question.title)}
secondary={getSecondaryText(question.answer_count)}
/>
<ListItemSecondaryAction>