🎨 Clean code

This commit is contained in:
Daniel 2025-01-12 22:16:03 +08:00
parent 61828f5367
commit 8996effcb2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1,7 +1,7 @@
import {Constants} from "../../constants";
import {uploadFiles, uploadLocalFiles} from "../upload";
import {processPasteCode, processRender} from "./processCode";
import {readText, writeText} from "./compatibility";
import {readText} from "./compatibility";
/// #if !BROWSER
import {clipboard} from "electron";
/// #endif
@ -95,7 +95,6 @@ export const getPlainText = (blockElement: HTMLElement, isNested = false) => {
export const pasteEscaped = async (protyle: IProtyle, nodeElement: Element) => {
try {
// * _ [ ] ! \ ` < > & ~ { } ( ) = # $ ^ | .
let clipText = await readText();
// 删掉 <span data-type\="text".*>text</span> 标签,只保留文本
clipText = clipText.replace(/<span data-type="text".*?>(.*?)<\/span>/g, "$1");