mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -416,9 +416,8 @@ export class WYSIWYG {
|
||||
html = tempElement.innerHTML;
|
||||
}
|
||||
// 不能使用 commonAncestorContainer https://ld246.com/article/1643282894693
|
||||
const codeBlockElement = hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock");
|
||||
textPlain = tempElement.textContent;
|
||||
if (codeBlockElement) {
|
||||
if (hasClosestByAttribute(range.startContainer, "data-type", "NodeCodeBlock")) {
|
||||
if (range.endContainer.textContent.length === range.endOffset &&
|
||||
(range.endContainer.parentElement.getAttribute("spellcheck") ? !range.endContainer.nextSibling : !range.endContainer.parentElement.nextSibling)) {
|
||||
textPlain = textPlain.replace(/\n$/, "");
|
||||
|
||||
Reference in New Issue
Block a user