mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-10 04:59:03 +08:00
This commit is contained in:
parent
97c5c22cb6
commit
6f70891a04
@ -373,12 +373,12 @@ export class Toolbar {
|
||||
item.style.fontSize = "";
|
||||
}
|
||||
if (index === 0 && previousElement && previousElement.nodeType !== 3 &&
|
||||
isArrayEqual(types, previousElement.getAttribute("data-type").split(" ")) &&
|
||||
isArrayEqual(types, (previousElement.getAttribute("data-type") || "").split(" ")) &&
|
||||
hasSameTextStyle(item, previousElement, textObj)) {
|
||||
previousIndex = previousElement.textContent.length;
|
||||
previousElement.innerHTML = previousElement.innerHTML + item.innerHTML;
|
||||
} else if (index === contents.childNodes.length - 1 && nextElement && nextElement.nodeType !== 3 &&
|
||||
isArrayEqual(types, nextElement.getAttribute("data-type").split(" ")) &&
|
||||
isArrayEqual(types, (nextElement.getAttribute("data-type") || "").split(" ")) &&
|
||||
hasSameTextStyle(item, nextElement, textObj)) {
|
||||
nextIndex = item.textContent.length;
|
||||
nextElement.innerHTML = item.innerHTML + nextElement.innerHTML;
|
||||
@ -490,12 +490,12 @@ export class Toolbar {
|
||||
}
|
||||
types = [...new Set(types)];
|
||||
if (index === 0 && previousElement && previousElement.nodeType !== 3 &&
|
||||
isArrayEqual(types, previousElement.getAttribute("data-type").split(" ")) &&
|
||||
isArrayEqual(types, (previousElement.getAttribute("data-type") || "").split(" ")) &&
|
||||
hasSameTextStyle(item, previousElement, textObj)) {
|
||||
previousIndex = previousElement.textContent.length;
|
||||
previousElement.innerHTML = previousElement.innerHTML + item.innerHTML;
|
||||
} else if (index === contents.childNodes.length - 1 && nextElement && nextElement.nodeType !== 3 &&
|
||||
isArrayEqual(types, nextElement.getAttribute("data-type").split(" ")) &&
|
||||
isArrayEqual(types, (nextElement.getAttribute("data-type") || "").split(" ")) &&
|
||||
hasSameTextStyle(item, nextElement, textObj)) {
|
||||
nextIndex = item.textContent.length;
|
||||
nextElement.innerHTML = item.innerHTML + nextElement.innerHTML;
|
||||
|
Loading…
Reference in New Issue
Block a user