mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 05:32:33 +01:00
This commit is contained in:
parent
51fe9b1a99
commit
5b8958d0df
2 changed files with 11 additions and 4 deletions
|
|
@ -16,7 +16,8 @@ export class InlineMemo extends ToolbarItem {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const memoElement = hasClosestByAttribute(range.startContainer, "data-type", "inline-memo");
|
const memoElement = hasClosestByAttribute(range.startContainer, "data-type", "inline-memo");
|
||||||
if (memoElement) {
|
if (memoElement && memoElement.textContent === range.toString()) {
|
||||||
|
// https://github.com/siyuan-note/siyuan/issues/6569
|
||||||
protyle.toolbar.showRender(protyle, memoElement);
|
protyle.toolbar.showRender(protyle, memoElement);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -544,12 +544,18 @@ export class Toolbar {
|
||||||
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
|
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
|
||||||
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
|
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
|
||||||
// 合并相同的 node
|
// 合并相同的 node
|
||||||
if (currentNewNode.getAttribute("data-type").indexOf("inline-math") > -1) {
|
const currentType = currentNewNode.getAttribute("data-type")
|
||||||
|
if (currentType.indexOf("inline-math") > -1) {
|
||||||
// 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028
|
// 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028
|
||||||
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));
|
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));
|
||||||
} else if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) {
|
} else if (currentType.indexOf("block-ref") === -1) {
|
||||||
// 引用不虚合并内容 https://ld246.com/article/1664454663564
|
// 引用不需合并内容 https://ld246.com/article/1664454663564
|
||||||
nextNewNode.innerHTML = currentNewNode.innerHTML + nextNewNode.innerHTML;
|
nextNewNode.innerHTML = currentNewNode.innerHTML + nextNewNode.innerHTML;
|
||||||
|
// 如果为备注时,合并备注内容
|
||||||
|
if (currentType.indexOf("inline-memo") > -1) {
|
||||||
|
nextNewNode.setAttribute("data-inline-memo-content", (currentNewNode.getAttribute("data-inline-memo-content") || "") +
|
||||||
|
(nextNewNode.getAttribute("data-inline-memo-content") || ""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
newNodes.splice(i, 1);
|
newNodes.splice(i, 1);
|
||||||
i--;
|
i--;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue