mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 03:49:11 +08:00
This commit is contained in:
parent
3348fd5f47
commit
c2d17ec929
@ -178,7 +178,7 @@ export const pasteAsPlainText = async (protyle: IProtyle) => {
|
|||||||
/// #endif
|
/// #endif
|
||||||
if (localFiles.length === 0) {
|
if (localFiles.length === 0) {
|
||||||
// Inline-level elements support pasted as plain text https://github.com/siyuan-note/siyuan/issues/8010
|
// Inline-level elements support pasted as plain text https://github.com/siyuan-note/siyuan/issues/8010
|
||||||
navigator.clipboard.readText().then(textPlain => {
|
let textPlain = await readText();
|
||||||
if (getSelection().rangeCount > 0) {
|
if (getSelection().rangeCount > 0) {
|
||||||
const range = getSelection().getRangeAt(0);
|
const range = getSelection().getRangeAt(0);
|
||||||
if (hasClosestByAttribute(range.startContainer, "data-type", "code") || hasClosestByClassName(range.startContainer, "hljs")) {
|
if (hasClosestByAttribute(range.startContainer, "data-type", "code") || hasClosestByClassName(range.startContainer, "hljs")) {
|
||||||
@ -211,7 +211,6 @@ export const pasteAsPlainText = async (protyle: IProtyle) => {
|
|||||||
// insertHTML 会进行内部反转义
|
// insertHTML 会进行内部反转义
|
||||||
insertHTML(content, protyle, false, false, true);
|
insertHTML(content, protyle, false, false, true);
|
||||||
filterClipboardHint(protyle, textPlain);
|
filterClipboardHint(protyle, textPlain);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user