diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts index 586045409..7bf63d18a 100644 --- a/app/src/config/bazaar.ts +++ b/app/src/config/bazaar.ts @@ -304,7 +304,7 @@ export const bazaar = { `; if (isDownloaded) { const mdElement = readmeElement.querySelector(".item__readme"); - mdElement.innerHTML = data.readme + mdElement.innerHTML = data.readme; highlightRender(mdElement); } else { fetchPost("/api/bazaar/getBazaarPackageREAME", { @@ -340,7 +340,7 @@ export const bazaar = { if (item.nodeType !== 3 && item.classList.contains("b3-button")) { item.classList.add("b3-button--outline"); } - }) + }); target.classList.remove("b3-button--outline"); this._genMyHTML(type.replace("my", "").toLowerCase() + "s" as TBazaarType); } diff --git a/app/src/protyle/util/hotKey.ts b/app/src/protyle/util/hotKey.ts index 54f62d657..86ad46445 100644 --- a/app/src/protyle/util/hotKey.ts +++ b/app/src/protyle/util/hotKey.ts @@ -69,7 +69,7 @@ export const matchHotKey = (hotKey: string, event: KeyboardEvent) => { // 是否匹配 ⇧⌘[] / ⌘[] const hasShift = hotKeys.length > 2 && (hotKeys[0] === "⇧"); let key = (hasShift ? hotKeys[2] : hotKeys[1]); - let keyCode + let keyCode; // 更新 electron 后不需要判断 Mac,但 Mac 下中英文有区别,需使用 keyCode 辅助 if (hasShift) { if (key === "-") { diff --git a/app/src/protyle/util/paste.ts b/app/src/protyle/util/paste.ts index 8067c5fcc..4ec6e400a 100644 --- a/app/src/protyle/util/paste.ts +++ b/app/src/protyle/util/paste.ts @@ -10,7 +10,7 @@ import {focusByWbr, getEditorRange} from "./selection"; import {blockRender} from "../markdown/blockRender"; import * as dayjs from "dayjs"; import {highlightRender} from "../markdown/highlightRender"; -import {transaction, updateTransaction} from "../wysiwyg/transaction"; +import {updateTransaction} from "../wysiwyg/transaction"; import {fetchPost, fetchSyncPost} from "../../util/fetch"; import {isDynamicRef, isFileAnnotation} from "../../util/functions"; import {insertHTML} from "./insertHTML"; diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index 70cb70e2b..68a46cbda 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -562,12 +562,12 @@ export const turnsIntoOneTransaction = (options: { protyle: IProtyle, selectsEle }; const removeUnfoldRepeatBlock = (html:string, protyle:IProtyle) => { - const temp = document.createElement("template") - temp.innerHTML = html + const temp = document.createElement("template"); + temp.innerHTML = html; Array.from(temp.content.children).forEach(item => { - protyle.wysiwyg.element.querySelector(`:scope > [data-node-id="${item.getAttribute("data-node-id")}"]`)?.remove() - }) -} + protyle.wysiwyg.element.querySelector(`:scope > [data-node-id="${item.getAttribute("data-node-id")}"]`)?.remove(); + }); +}; export const turnsIntoTransaction = (options: { protyle: IProtyle, @@ -578,11 +578,11 @@ export const turnsIntoTransaction = (options: { isContinue?: boolean, }) => { let selectsElement: Element[] = options.selectsElement; - let range: Range + let range: Range; // 通过快捷键触发 if (options.nodeElement) { range = getSelection().getRangeAt(0); - range.insertNode(document.createElement("wbr")) + range.insertNode(document.createElement("wbr")); selectsElement = Array.from(options.protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select")); if (selectsElement.length === 0) { selectsElement = [options.nodeElement];