📋 refactor: Prevent RTF Paste to Clipboard Only Plain Text (#3179)

This commit is contained in:
Danny Avila 2024-06-23 18:07:28 -04:00 committed by GitHub
parent c99cf1b4b1
commit dd563e0796
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ const CodeBar: React.FC<CodeBarProps> = React.memo(({ lang, codeRef, error, plug
const codeString = codeRef.current?.textContent;
if (codeString) {
setIsCopied(true);
copy(codeString);
copy(codeString, { format: 'text/plain' });
setTimeout(() => {
setIsCopied(false);

View file

@ -19,7 +19,7 @@ export default function useCopyToClipboard({
return acc;
}, '');
}
copy(messageText ?? '');
copy(messageText ?? '', { format: 'text/plain' });
setTimeout(() => {
setIsCopied(false);