diff --git a/app/src/protyle/markdown/mathRender.ts b/app/src/protyle/markdown/mathRender.ts index fdb0ff735..bb296ff37 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 ad06beff2..f219b9c1d 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 4dd349723..2342ba44c 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);