Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:rotating_light:

Vanessa6851656c09fc
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 5452b3a441..930303887c 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -11,7 +11,7 @@ import {
setFirstNodeRange,
setLastNodeRange
} from "../util/selection";
-import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByMatchTag} from "../util/hasClosest";
+import {hasClosestBlock, hasClosestByClassName} from "../util/hasClosest";
import {Link} from "./Link";
import {setPosition} from "../../util/setPosition";
import {updateTransaction} from "../wysiwyg/transaction";
@@ -859,33 +859,33 @@ export class Toolbar {
}
}
if (isInlineMemo) {
- let inlineMemoElements
+ let inlineMemoElements;
if (updateElements) {
- inlineMemoElements = updateElements
+ inlineMemoElements = updateElements;
} else {
- inlineMemoElements = [renderElement]
+ inlineMemoElements = [renderElement];
}
inlineMemoElements.forEach((item, index) => {
if (!target.value) {
// https://github.com/siyuan-note/insider/issues/1046
- const currentTypes = item.getAttribute("data-type").split(" ")
+ const currentTypes = item.getAttribute("data-type").split(" ");
if (currentTypes.length === 1 && currentTypes[0] === "inline-memo") {
item.outerHTML = item.innerHTML + (index === inlineMemoElements.length - 1 ? "<wbr>" : "");
focusByWbr(nodeElement, this.range);
} else {
currentTypes.find((typeItem, index) => {
if (typeItem === "inline-memo") {
- currentTypes.splice(index, 1)
- return true
+ currentTypes.splice(index, 1);
+ return true;
}
- })
+ });
item.setAttribute("data-type", currentTypes.join(" "));
item.removeAttribute("data-inline-memo-content");
}
} else {
item.setAttribute("data-inline-memo-content", Lute.EscapeHTMLStr(target.value));
}
- })
+ });
} else if (type === "NodeBlockQueryEmbed") {
blockRender(protyle, renderElement);
}
diff --git a/app/src/protyle/util/insertHTML.ts b/app/src/protyle/util/insertHTML.ts
index 2d8d0677f0..0a0257d581 100644
--- a/app/src/protyle/util/insertHTML.ts
+++ b/app/src/protyle/util/insertHTML.ts
@@ -1,4 +1,4 @@
-import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName, hasClosestByMatchTag} from "./hasClosest";
+import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "./hasClosest";
import * as dayjs from "dayjs";
import {removeEmbed} from "../wysiwyg/removeEmbed";
import {transaction, updateTransaction} from "../wysiwyg/transaction";
diff --git a/app/src/protyle/util/selection.ts b/app/src/protyle/util/selection.ts
index 1cd361de78..ea5f701fd4 100644
--- a/app/src/protyle/util/selection.ts
+++ b/app/src/protyle/util/selection.ts
@@ -45,7 +45,7 @@ export const fixTableRange = (range:Range) => {
}
}
}
-}
+};
export const selectAll = (protyle: IProtyle, nodeElement: Element, range: Range) => {
const editElement = getContenteditableElement(nodeElement);
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index cfe6aca0c2..fc21ab5051 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -846,12 +846,12 @@ export class WYSIWYG {
let cursorElement = hasClosestBlock(range.startContainer) as Element;
if (cursorElement) {
if (cursorElement.nextElementSibling?.classList.contains("table")) {
- setLastNodeRange(getContenteditableElement(cursorElement), range, false)
+ setLastNodeRange(getContenteditableElement(cursorElement), range, false);
} else if (cursorElement.classList.contains("table")) {
const cellElements = cursorElement.querySelectorAll("th, td");
cursorElement = cellElements[cellElements.length - 1];
if (cursorElement.contains(range.startContainer)) {
- setLastNodeRange(cursorElement, range, false)
+ setLastNodeRange(cursorElement, range, false);
}
}
}