mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-27 11:58:49 +01:00
This commit is contained in:
parent
ad4964103d
commit
acf8aa5ffa
1 changed files with 8 additions and 6 deletions
|
|
@ -382,12 +382,14 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
|||
isBlock = false;
|
||||
block2text = true;
|
||||
}
|
||||
// 通过右键粘贴包含属性的块需保留整个块 https://github.com/siyuan-note/siyuan/issues/15268
|
||||
for (let i = 0; i < tempElement.content.firstElementChild.attributes.length; i++) {
|
||||
const attribute = tempElement.content.firstElementChild.attributes[i];
|
||||
if (["memo", "name", "alias", "bookmark"].includes(attribute.name) || attribute.name.startsWith("custom-")) {
|
||||
isBlock = true;
|
||||
break;
|
||||
if (!isBlock && tempElement && tempElement.content.childElementCount === 1) {
|
||||
// 通过右键粘贴包含属性的块需保留整个块 https://github.com/siyuan-note/siyuan/issues/15268
|
||||
for (let i = 0; i < tempElement.content.firstElementChild.attributes.length; i++) {
|
||||
const attribute = tempElement.content.firstElementChild.attributes[i];
|
||||
if (["memo", "name", "alias", "bookmark"].includes(attribute.name) || attribute.name.startsWith("custom-")) {
|
||||
isBlock = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 使用 lute 方法会添加 p 元素,只有一个 p 元素或者只有一个字符串或者为 <u>b</u> 时的时候只拷贝内部
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue