Skip to content

Commit

Permalink
refactor: clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC committed Feb 3, 2025
1 parent 301177a commit 9175ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/protyle/wysiwyg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 9175ca0

Please sign in to comment.