mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
e9df16cfd7
commit
dff19ad095
1 changed files with 1 additions and 2 deletions
|
|
@ -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$/, "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue