mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-15 21:25:28 +01:00
This commit is contained in:
parent
a9351cc4eb
commit
8a70277add
1 changed files with 5 additions and 3 deletions
|
|
@ -260,13 +260,15 @@ export const duplicateBlock = async (nodeElements: Element[], protyle: IProtyle)
|
|||
const undoOperations: IOperation[] = [];
|
||||
let starIndex: number;
|
||||
let lastElement = nodeElements[nodeElements.length - 1];
|
||||
let isSameLi = true;
|
||||
if (lastElement.classList.contains("li")) {
|
||||
if (lastElement.getAttribute("data-subtype") === "o") {
|
||||
starIndex = parseInt(lastElement.getAttribute("data-marker"), 10);
|
||||
}
|
||||
const isSameLi = nodeElements.find(item => {
|
||||
if (item.classList.contains("li") &&
|
||||
nodeElements.find(item => {
|
||||
if (!item.classList.contains("li") ||
|
||||
lastElement.getAttribute("data-subtype") !== item.getAttribute("data-subtype")) {
|
||||
isSameLi = false;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
@ -290,7 +292,7 @@ export const duplicateBlock = async (nodeElements: Element[], protyle: IProtyle)
|
|||
foldTempElement.innerHTML = response.data.dom;
|
||||
tempElement = foldTempElement.content.firstElementChild as HTMLElement;
|
||||
}
|
||||
if (item.getAttribute("data-type") === "NodeListItem") {
|
||||
if (item.getAttribute("data-type") === "NodeListItem" && !isSameLi) {
|
||||
if (!listHTML) {
|
||||
listHTML = `<div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div></div>`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue