diff --git a/components/LiveFeed/Contribution/ContributionEntry.tsx b/components/LiveFeed/Contribution/ContributionEntry.tsx
index f7086c742..7704cb642 100644
--- a/components/LiveFeed/Contribution/ContributionEntry.tsx
+++ b/components/LiveFeed/Contribution/ContributionEntry.tsx
@@ -20,6 +20,7 @@ import ContributionHeader from "../Contribution/ContributionHeader";
import HubTag from "~/components/Hubs/HubTag";
import { parseHub } from "~/config/types/hub";
import DocumentHubs from "~/components/Document/lib/DocumentHubs";
+import sanitizeHtml from "sanitize-html";
type Args = {
entry: Contribution;
@@ -80,7 +81,10 @@ const ContributionEntry = ({
);
title = (
- {item?.source.unifiedDocument?.document?.title}
+ {sanitizeHtml(item?.source.unifiedDocument?.document?.title, {
+ allowedTags: [],
+ allowedAttributes: {},
+ })}
);
}
@@ -102,7 +106,10 @@ const ContributionEntry = ({
} else {
title = (
- {item.unifiedDocument?.document?.title}
+ {sanitizeHtml(item.unifiedDocument?.document?.title, {
+ allowedTags: [],
+ allowedAttributes: {},
+ })}
);
body = truncateText(
@@ -146,7 +153,10 @@ const ContributionEntry = ({
overrideStyle={styles.documentLink}
href={getUrlToUniDoc(item?.unifiedDocument)}
>
- {item?.unifiedDocument?.document?.title ?? item?.title ?? ""}
+ {sanitizeHtml(item?.unifiedDocument?.document?.title ?? item?.title ?? "", {
+ allowedTags: [],
+ allowedAttributes: {},
+ })}
);
break;