diff --git a/components/ComposeEmail.tsx b/components/ComposeEmail.tsx index 421aa880..235c16cf 100644 --- a/components/ComposeEmail.tsx +++ b/components/ComposeEmail.tsx @@ -54,13 +54,7 @@ export default function ComposeEmail({ // Update the contentEditable div when composeBody changes useEffect(() => { if (composeBodyRef.current && composeBody) { - // Clear existing content - composeBodyRef.current.innerHTML = ''; - // Create a temporary div to parse the HTML - const tempDiv = document.createElement('div'); - tempDiv.innerHTML = composeBody; - // Append the parsed content - composeBodyRef.current.appendChild(tempDiv); + composeBodyRef.current.innerHTML = composeBody; } }, [composeBody]); @@ -232,6 +226,7 @@ export default function ComposeEmail({ fontSize: 'inherit', lineHeight: 'inherit', }} + dangerouslySetInnerHTML={{ __html: composeBody }} onInput={handleInput} />