tangled
alpha
login
or
join now
onedeuxtriseigo.nullpo.dev
/
siyuan
0
fork
atom
A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
0
fork
atom
overview
issues
pulls
pipelines
:bug: fix https://github.com/siyuan-note/siyuan/issues/6569
Vanessa
3 years ago
5b8958d0
51fe9b1a
+11
-4
2 changed files
expand all
collapse all
unified
split
app
src
protyle
toolbar
InlineMemo.ts
index.ts
+2
-1
app/src/protyle/toolbar/InlineMemo.ts
···
16
16
return;
17
17
}
18
18
const memoElement = hasClosestByAttribute(range.startContainer, "data-type", "inline-memo");
19
19
-
if (memoElement) {
19
19
+
if (memoElement && memoElement.textContent === range.toString()) {
20
20
+
// https://github.com/siyuan-note/siyuan/issues/6569
20
21
protyle.toolbar.showRender(protyle, memoElement);
21
22
return;
22
23
}
+9
-3
app/src/protyle/toolbar/index.ts
···
544
544
currentNewNode.style.fontSize === nextNewNode.style.fontSize &&
545
545
currentNewNode.style.backgroundColor === nextNewNode.style.backgroundColor) {
546
546
// 合并相同的 node
547
547
-
if (currentNewNode.getAttribute("data-type").indexOf("inline-math") > -1) {
547
547
+
const currentType = currentNewNode.getAttribute("data-type")
548
548
+
if (currentType.indexOf("inline-math") > -1) {
548
549
// 数学公式合并 data-content https://github.com/siyuan-note/siyuan/issues/6028
549
550
nextNewNode.setAttribute("data-content", currentNewNode.getAttribute("data-content") + nextNewNode.getAttribute("data-content"));
550
550
-
} else if (currentNewNode.getAttribute("data-type").indexOf("block-ref") === -1) {
551
551
-
// 引用不虚合并内容 https://ld246.com/article/1664454663564
551
551
+
} else if (currentType.indexOf("block-ref") === -1) {
552
552
+
// 引用不需合并内容 https://ld246.com/article/1664454663564
552
553
nextNewNode.innerHTML = currentNewNode.innerHTML + nextNewNode.innerHTML;
554
554
+
// 如果为备注时,合并备注内容
555
555
+
if (currentType.indexOf("inline-memo") > -1) {
556
556
+
nextNewNode.setAttribute("data-inline-memo-content", (currentNewNode.getAttribute("data-inline-memo-content") || "") +
557
557
+
(nextNewNode.getAttribute("data-inline-memo-content") || ""));
558
558
+
}
553
559
}
554
560
newNodes.splice(i, 1);
555
561
i--;