This commit is contained in:
parent
49fcc7b33f
commit
215f9de4ca
1 changed files with 9 additions and 4 deletions
|
@ -28,7 +28,7 @@ import {
|
|||
getLastBlock, getNextBlock,
|
||||
getPreviousHeading,
|
||||
getTopAloneElement,
|
||||
hasNextSibling,
|
||||
hasNextSibling, hasPreviousSibling,
|
||||
isNotEditBlock
|
||||
} from "./getBlock";
|
||||
import {transaction, updateTransaction} from "./transaction";
|
||||
|
@ -1183,11 +1183,16 @@ export class WYSIWYG {
|
|||
// https://github.com/siyuan-note/siyuan/issues/3257
|
||||
if (range.toString() === "" && range.startContainer.nodeType === 3 && !protyle.toolbar.isNewEmptyInline &&
|
||||
// https://github.com/siyuan-note/siyuan/issues/4118
|
||||
range.startOffset >= range.startContainer.textContent.length && !hasNextSibling(range.startContainer) &&
|
||||
range.startOffset >= range.startContainer.textContent.length &&
|
||||
protyle.toolbar.getCurrentType(range).length > 0) {
|
||||
// 粗体等行内元素粘贴
|
||||
range.setEndAfter(range.startContainer.parentElement);
|
||||
range.collapse(false);
|
||||
if (!hasNextSibling(range.startContainer)) {
|
||||
range.setEndAfter(range.startContainer.parentElement);
|
||||
range.collapse(false);
|
||||
} else if (!hasPreviousSibling(range.startContainer)) {
|
||||
range.setStartBefore(range.startContainer.parentElement);
|
||||
range.collapse(true);
|
||||
}
|
||||
}
|
||||
paste(protyle, event);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue