🎨 复制纯文本 时移除所有零宽空格 Fix https://github.com/siyuan-note/siyuan/issues/6674

This commit is contained in:
Liang Ding 2022-11-22 00:56:37 +08:00
parent 3ab71117f6
commit 14a8b1f8a4
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 13 additions and 7 deletions

View file

@ -1,5 +1,6 @@
import {focusByRange} from "./selection";
import {fetchPost} from "../../util/fetch";
import {Constants} from "../../constants";
export const openByMobile = (uri: string) => {
if (!uri) {
@ -59,6 +60,11 @@ export const writeText = async (text: string) => {
}
};
export const copyPlainText = async (text: string) => {
text = text.replace(new RegExp(Constants.ZWSP, "g"), ""); // `复制纯文本` 时移除所有零宽空格 https://github.com/siyuan-note/siyuan/issues/6674
await writeText(text);
};
// 用户 iPhone 点击延迟/需要双击的处理
export const getEventName = () => {
if (navigator.userAgent.indexOf("iPhone") > -1) {