diff --git a/frontend/src/pages/Broadcast/Component/AllBroadcasts/Card/Card.jsx b/frontend/src/pages/Broadcast/Component/AllBroadcasts/Card/Card.jsx index d7fc290a..46503411 100644 --- a/frontend/src/pages/Broadcast/Component/AllBroadcasts/Card/Card.jsx +++ b/frontend/src/pages/Broadcast/Component/AllBroadcasts/Card/Card.jsx @@ -2,6 +2,7 @@ import React, { useState } from "react"; import ReactCardFlip from "react-card-flip"; import { Modals } from "../../Carousel/Modal/index.js"; import style from "./card.module.scss"; +import DOMPurify from "dompurify"; export function Card(props) { let dark = props.theme; @@ -39,6 +40,12 @@ export function Card(props) { "December", ]; + const sanitizedContent = DOMPurify.sanitize(props.project.content); + const truncatedContent = + sanitizedContent.length > 250 + ? sanitizedContent.substring(0, 250) + "..." + : sanitizedContent; + return (