From a720c4407012c0fdf9a6016f168ca5900eb61640 Mon Sep 17 00:00:00 2001 From: Brian Fletcher Date: Mon, 22 Aug 2022 20:00:10 +0100 Subject: [PATCH] unescape html entities from stackoverflow api response Signed-off-by: Brian Fletcher --- .changeset/tender-ladybugs-relax.md | 5 +++++ .../src/home/StackOverflowQuestions/Content.tsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/tender-ladybugs-relax.md diff --git a/.changeset/tender-ladybugs-relax.md b/.changeset/tender-ladybugs-relax.md new file mode 100644 index 0000000000..94750632e1 --- /dev/null +++ b/.changeset/tender-ladybugs-relax.md @@ -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. diff --git a/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx b/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx index fbc3a90a9d..d562b749b1 100644 --- a/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx +++ b/plugins/stack-overflow/src/home/StackOverflowQuestions/Content.tsx @@ -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) => { {props.icon && {props.icon}}