mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-08 00:04:21 +01:00
This commit is contained in:
parent
bcb725f0ad
commit
aef26a743a
1 changed files with 11 additions and 3 deletions
|
|
@ -1,4 +1,10 @@
|
|||
import {focusBlock, focusByRange, focusByWbr, getSelectionOffset, setLastNodeRange} from "../util/selection";
|
||||
import {
|
||||
focusBlock,
|
||||
focusByRange,
|
||||
focusByWbr,
|
||||
getSelectionOffset,
|
||||
setLastNodeRange
|
||||
} from "../util/selection";
|
||||
import {
|
||||
getContenteditableElement,
|
||||
getLastBlock,
|
||||
|
|
@ -272,7 +278,8 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
|||
}
|
||||
|
||||
let isCallout = blockElement.parentElement.classList.contains("callout-content");
|
||||
if (type === "Delete") {
|
||||
if (type === "Delete" &&
|
||||
(!blockElement.previousElementSibling || blockElement.previousElementSibling.classList.contains("protyle-action"))) {
|
||||
const bqCaElement = hasClosestByClassName(blockElement, "bq") || hasClosestByClassName(blockElement, "callout");
|
||||
if (bqCaElement) {
|
||||
isCallout = bqCaElement.classList.contains("callout");
|
||||
|
|
@ -335,7 +342,8 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
|||
removeLi(protyle, blockElement, range, type === "Delete");
|
||||
return;
|
||||
}
|
||||
if (type === "Delete") {
|
||||
if (type === "Delete" &&
|
||||
(!blockElement.previousElementSibling || blockElement.previousElementSibling.classList.contains("protyle-action"))) {
|
||||
const liElement = hasClosestByClassName(blockElement, "li");
|
||||
if (liElement) {
|
||||
removeLi(protyle, liElement.firstElementChild.nextElementSibling, range, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue