From 5dadd4bf2c3427adac770fb5007147ca79d64310 Mon Sep 17 00:00:00 2001 From: gahusb Date: Tue, 7 Apr 2026 02:32:54 +0900 Subject: [PATCH] =?UTF-8?q?fix(blog-marketing):=20=EB=B3=B8=EB=AC=B8=20?= =?UTF-8?q?=EB=B3=B5=EC=82=AC=20=EC=8B=9C=20HTML=20=EC=84=9C=EC=8B=9D=20?= =?UTF-8?q?=EC=9C=A0=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit writeText 대신 clipboard.write로 text/html MIME 타입 복사하여 네이버 블로그 에디터에 붙여넣기 시 서식이 유지되도록 개선. Co-Authored-By: Claude Opus 4.6 --- src/pages/blog-marketing/BlogMarketing.jsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pages/blog-marketing/BlogMarketing.jsx b/src/pages/blog-marketing/BlogMarketing.jsx index 954b931..f602d1c 100644 --- a/src/pages/blog-marketing/BlogMarketing.jsx +++ b/src/pages/blog-marketing/BlogMarketing.jsx @@ -33,6 +33,14 @@ function fmtMoney(n) { if (n == null) return '-'; return n.toLocaleString('ko-KR') + '원'; } +function copyHtmlToClipboard(html) { + const blob = new Blob([html], { type: 'text/html' }); + const plainBlob = new Blob([html.replace(/<[^>]*>/g, '')], { type: 'text/plain' }); + navigator.clipboard.write([ + new ClipboardItem({ 'text/html': blob, 'text/plain': plainBlob }), + ]).then(() => alert('본문이 클립보드에 복사되었습니다! (서식 포함)')); +} + function scoreColor(v, max = 100) { const r = v / max; if (r >= 0.6) return 'bm-score__value--high'; @@ -404,7 +412,7 @@ function WriteTab() { const handleCopy = () => { if (!post) return; - navigator.clipboard.writeText(post.body).then(() => alert('본문이 클립보드에 복사되었습니다!')); + copyHtmlToClipboard(post.body); }; const handleAddLink = async () => { @@ -609,7 +617,7 @@ function PostsTab() { }; const handleCopy = (body) => { - navigator.clipboard.writeText(body).then(() => alert('복사 완료!')); + copyHtmlToClipboard(body); }; const filters = [