mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 04:18:48 +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;
|
||||
}
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -544,12 +544,18 @@ export class Toolbar {
|
|||
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
|
||||
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
|
||||
// 合并相同的 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
|
||||
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));
|
||||
} else if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) {
|
||||
// 引用不虚合并内容 https://ld246.com/article/1664454663564
|
||||
} else if (currentType.indexOf("block-ref") === -1) {
|
||||
// 引用不需合并内容 https://ld246.com/article/1664454663564
|
||||
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);
|
||||
i--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue