From 9175ca0145ac91f0c1bcab7d9529f9ce065749bd Mon Sep 17 00:00:00 2001 From: Jeffrey Chen <78434827+TCOTC@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:07:57 +0800 Subject: [PATCH] refactor: clean code fix https://github.com/siyuan-note/siyuan/pull/14002 --- app/src/protyle/wysiwyg/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index faae12fa8f8..d583717cae3 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -416,9 +416,9 @@ export class WYSIWYG { } // 不能使用 commonAncestorContainer https://ld246.com/article/1643282894693 if (hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock")) { - textPlain = tempElement.textContent.replace(Constants.ZWSP, "").replace(/\n$/, ""); + textPlain = tempElement.textContent.replace(/\n$/, ""); } else if (hasClosestByMatchTag(range.startContainer, "CODE")) { - textPlain = tempElement.textContent.replace(Constants.ZWSP, ""); + textPlain = tempElement.textContent; } else { textPlain = range.toString(); }