mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
This commit is contained in:
parent
4c53bd294e
commit
4af21d1756
1 changed files with 7 additions and 9 deletions
|
|
@ -100,16 +100,14 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
|
||||||
textHTML = "";
|
textHTML = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// process word
|
if (!textHTML.endsWith(Constants.ZWSP) && !textHTML.startsWith(Constants.ZWSP)) {
|
||||||
const doc = new DOMParser().parseFromString(textHTML, "text/html");
|
// process word
|
||||||
let wordHTML = "";
|
const doc = new DOMParser().parseFromString(textHTML, "text/html");
|
||||||
if (doc.body) {
|
if (doc.body && doc.body.innerHTML) {
|
||||||
wordHTML = doc.body.innerHTML;
|
textHTML = doc.body.innerHTML;
|
||||||
}
|
}
|
||||||
// 复制空格的时候不能让其转换为空
|
|
||||||
if (wordHTML !== Constants.ZWSP) {
|
|
||||||
textHTML = wordHTML;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
textHTML = Lute.Sanitize(textHTML);
|
textHTML = Lute.Sanitize(textHTML);
|
||||||
|
|
||||||
const nodeElement = hasClosestBlock(event.target);
|
const nodeElement = hasClosestBlock(event.target);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue