mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 04:31:50 +08:00
This commit is contained in:
parent
80af4ad069
commit
31b97d86d0
@ -40,7 +40,7 @@ export const readText = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const readClipboard = async () => {
|
export const readClipboard = async () => {
|
||||||
const text: { textPlain?: string, textHTML?: string } = {};
|
const text = {textPlain: "", textHTML: ""};
|
||||||
if (isInAndroid()) {
|
if (isInAndroid()) {
|
||||||
text.textPlain = window.JSAndroid.readClipboard();
|
text.textPlain = window.JSAndroid.readClipboard();
|
||||||
} else if (isInHarmony()) {
|
} else if (isInHarmony()) {
|
||||||
|
@ -128,7 +128,7 @@ export const pasteEscaped = async (protyle: IProtyle, nodeElement: Element) => {
|
|||||||
.replace(/\|/g, "\\|")
|
.replace(/\|/g, "\\|")
|
||||||
.replace(/\./g, "\\.");
|
.replace(/\./g, "\\.");
|
||||||
// 转义文本不能使用 DOM 结构 https://github.com/siyuan-note/siyuan/issues/11778
|
// 转义文本不能使用 DOM 结构 https://github.com/siyuan-note/siyuan/issues/11778
|
||||||
paste(protyle, {textPlain: clipText, target: nodeElement as HTMLElement});
|
paste(protyle, {textPlain: clipText, textHTML: "", target: nodeElement as HTMLElement});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
@ -496,7 +496,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
|
|||||||
} else if (files && files.length > 0) {
|
} else if (files && files.length > 0) {
|
||||||
uploadFiles(protyle, files);
|
uploadFiles(protyle, files);
|
||||||
return;
|
return;
|
||||||
} else if (textPlain.trim() !== "" && files && files.length === 0) {
|
} else if (textPlain.trim() !== "" && (files && files.length === 0 || !files)) {
|
||||||
if (range.toString() !== "") {
|
if (range.toString() !== "") {
|
||||||
const firstLine = textPlain.split("\n")[0];
|
const firstLine = textPlain.split("\n")[0];
|
||||||
if (isDynamicRef(textPlain)) {
|
if (isDynamicRef(textPlain)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user