mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 16:58:49 +01:00
This commit is contained in:
parent
71c24646cb
commit
40c4f5f756
1 changed files with 7 additions and 5 deletions
|
|
@ -1026,11 +1026,13 @@ export class Toolbar {
|
|||
if (types.includes("NodeHTMLBlock")) {
|
||||
// 需 div 包裹,否则行内元素会解析错误 https://github.com/siyuan-note/siyuan/issues/6764
|
||||
let html = textElement.value;
|
||||
if (!html.startsWith("<div>\n")) {
|
||||
html = `<div>\n${html}`;
|
||||
}
|
||||
if (!html.startsWith("\n</div>")) {
|
||||
html = `${html}\n</div>`;
|
||||
if (html) {
|
||||
if (!html.startsWith("<div>\n")) {
|
||||
html = `<div>\n${html}`;
|
||||
}
|
||||
if (!html.endsWith("\n</div>")) {
|
||||
html = `${html}\n</div>`;
|
||||
}
|
||||
}
|
||||
renderElement.querySelector("protyle-html").setAttribute("data-content", Lute.EscapeHTMLStr(html));
|
||||
} else if (isInlineMemo) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue