diff --git a/components/ComposeEmail.tsx b/components/ComposeEmail.tsx index 6ab4692d..24fee132 100644 --- a/components/ComposeEmail.tsx +++ b/components/ComposeEmail.tsx @@ -56,26 +56,14 @@ export default function ComposeEmail({ useEffect(() => { if (composeBodyRef.current) { const decodedContent = decodeComposeContent(composeBody); - composeBodyRef.current.innerHTML = decodedContent - .replace(/]*>/g, '
') - .replace(/]*>/g, '

'); + composeBodyRef.current.innerHTML = decodedContent; } }, [composeBody]); const handleInput = (e: React.FormEvent) => { if (composeBodyRef.current) { - const content = composeBodyRef.current.innerHTML - .replace(/
/g, '
') - .replace(/

/g, '

') - .replace(/<\/p>/g, '

') - .replace(/
/g, '
') - .replace(/<\/div>/g, '
') - .replace(//g, '') - .replace(/<\/span>/g, ''); - - const encodedContent = encodeComposeContent( - `
${content}
` - ); + const content = composeBodyRef.current.innerHTML; + const encodedContent = encodeComposeContent(content); setComposeBody(encodedContent); } }; @@ -237,10 +225,10 @@ export default function ComposeEmail({ className="w-full h-full mt-1 bg-white border border-gray-300 rounded-md p-2 text-gray-900 overflow-y-auto" style={{ minHeight: '200px', - direction: 'ltr', - textAlign: 'left' + unicodeBidi: 'plaintext', + textAlign: 'start' }} - dir="ltr" + dir="auto" data-gramm="false" data-gramm_editor="false" data-enable-grammarly="false"