Skip to content

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

:rotating_light:

Vanessa5a4ed2b47887
diff --git a/app/src/protyle/markdown/mathRender.ts b/app/src/protyle/markdown/mathRender.ts
index fdb0ff7354..bb296ff37f 100644
--- a/app/src/protyle/markdown/mathRender.ts
+++ b/app/src/protyle/markdown/mathRender.ts
@@ -66,15 +66,15 @@ export const mathRender = (element: Element, cdn = Constants.PROTYLE_CDN, maxWid
}
} else {
if (blockElement && mathElement.getBoundingClientRect().width > blockElement.clientWidth) {
- mathElement.style.maxWidth = "100%"
- mathElement.style.overflowX = "auto"
- mathElement.style.overflowY = "hidden"
- mathElement.style.display = "inline-block"
+ mathElement.style.maxWidth = "100%";
+ mathElement.style.overflowX = "auto";
+ mathElement.style.overflowY = "hidden";
+ mathElement.style.display = "inline-block";
} else {
- mathElement.style.maxWidth = ""
- mathElement.style.overflowX = ""
- mathElement.style.overflowY = ""
- mathElement.style.display = ""
+ mathElement.style.maxWidth = "";
+ mathElement.style.overflowX = "";
+ mathElement.style.overflowY = "";
+ mathElement.style.display = "";
}
const nextSibling = hasNextSibling(mathElement);
if (!nextSibling) {
diff --git a/app/src/protyle/toolbar/InlineMath.ts b/app/src/protyle/toolbar/InlineMath.ts
index ad06beff23..f219b9c1d5 100644
--- a/app/src/protyle/toolbar/InlineMath.ts
+++ b/app/src/protyle/toolbar/InlineMath.ts
@@ -1,7 +1,7 @@
import {ToolbarItem} from "./ToolbarItem";
import * as dayjs from "dayjs";
import {updateTransaction} from "../wysiwyg/transaction";
-import {hasClosestBlock, hasClosestByAttribute} from "../util/hasClosest";
+import {hasClosestBlock} from "../util/hasClosest";
import {hasNextSibling, hasPreviousSibling} from "../wysiwyg/getBlock";
import {focusByRange, focusByWbr} from "../util/selection";
import {mathRender} from "../markdown/mathRender";
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index 4dd349723e..2342ba44cd 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -6,7 +6,6 @@ import {
focusByWbr,
focusSideBlock,
getEditorRange,
- getSelectionOffset,
getSelectionPosition,
setFirstNodeRange,
setLastNodeRange
@@ -16,7 +15,6 @@ import {Link} from "./Link";
import {setPosition} from "../../util/setPosition";
import {updateTransaction} from "../wysiwyg/transaction";
import {Constants} from "../../constants";
-import {mathRender} from "../markdown/mathRender";
import {getEventName} from "../util/compatibility";
import {upDownHint} from "../../util/upDownHint";
import {highlightRender} from "../markdown/highlightRender";
@@ -386,7 +384,7 @@ export class Toolbar {
}
if (selectText === "") {
const inlineElement = document.createElement("span");
- rangeTypes.push(type)
+ rangeTypes.push(type);
inlineElement.setAttribute("data-type", [...new Set(rangeTypes)].join(" "));
inlineElement.textContent = Constants.ZWSP;
newNodes.push(inlineElement);
@@ -424,7 +422,7 @@ export class Toolbar {
hasSameTextStyle(item, nextElement, textObj)) {
nextIndex = item.textContent.length;
nextElement.innerHTML = item.innerHTML + nextElement.innerHTML;
- } else if (item.tagName !== 'BR') {
+ } else if (item.tagName !== "BR") {
item.setAttribute("data-type", types.join(" "));
setFontStyle(item, textObj);
newNodes.push(item);