mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
1a12ba97e6
commit
cffec4b0e8
1 changed files with 5 additions and 0 deletions
|
|
@ -383,8 +383,10 @@ export class WYSIWYG {
|
|||
this.emojiToMd(tempElement);
|
||||
}
|
||||
html = tempElement.innerHTML;
|
||||
textPlain = range.toString();
|
||||
} else if (selectImgElement) {
|
||||
html = selectImgElement.outerHTML;
|
||||
textPlain = selectImgElement.querySelector("img").getAttribute("data-src");
|
||||
} else if (selectTypes.length > 0 && range.startContainer.nodeType === 3 && range.startContainer.parentElement.tagName === "SPAN" &&
|
||||
range.startContainer.parentElement.isSameNode(range.endContainer.parentElement)) {
|
||||
// 复制粗体等字体中的一部分
|
||||
|
|
@ -400,6 +402,7 @@ export class WYSIWYG {
|
|||
}
|
||||
spanElement.textContent = range.toString();
|
||||
html = spanElement.outerHTML;
|
||||
textPlain = range.toString();
|
||||
} else {
|
||||
tempElement.append(range.cloneContents());
|
||||
this.emojiToMd(tempElement);
|
||||
|
|
@ -415,6 +418,8 @@ export class WYSIWYG {
|
|||
textPlain = tempElement.textContent.replace(Constants.ZWSP, "").replace(/\n$/, "");
|
||||
} else if (hasClosestByMatchTag(range.startContainer, "CODE")) {
|
||||
textPlain = tempElement.textContent.replace(Constants.ZWSP, "");
|
||||
} else {
|
||||
textPlain = range.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue