diff --git a/react/src/components/InboxEmail/index.js b/react/src/components/InboxEmail/index.js index f5728b0..948dd25 100644 --- a/react/src/components/InboxEmail/index.js +++ b/react/src/components/InboxEmail/index.js @@ -7,6 +7,7 @@ import InfoIcon from "@mui/icons-material/Info"; import { ThemeContext } from "../../context/ThemeContext"; import { useContext } from "react"; import { motion } from "framer-motion"; +import DOMPurify from "dompurify"; const InboxEmail = () => { @@ -150,8 +151,9 @@ const InboxEmail = () => { > From: {emailData ? emailData.from.text : "No From"} - emailData ? navigator.clipboard.writeText(emailData.to.text) : null} + (emailData ? navigator.clipboard.writeText(emailData.to.text) : null)} /> @@ -169,7 +171,7 @@ const InboxEmail = () => { justifyContent: "center", wordBreak: "break-all", }} - dangerouslySetInnerHTML={{ __html: emailData ? emailData.textAsHtml : "No Message" }} + dangerouslySetInnerHTML={{ __html: emailData ? DOMPurify.sanitize(emailData.html) : "No Message" }} /> @@ -190,11 +192,7 @@ const InboxEmail = () => { })} - +