diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index f8b8f0d4c..a1ee8e9d4 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -1019,7 +1019,14 @@ export class Toolbar {
}
let inlineLastNode: Element;
if (types.includes("NodeHTMLBlock")) {
- renderElement.querySelector("protyle-html").setAttribute("data-content", Lute.EscapeHTMLStr(textElement.value));
+ // 需 div 包裹,否则行内元素会解析错误 https://github.com/siyuan-note/siyuan/issues/6764
+ let html = textElement.value;
+ if (!html.startsWith("
\n")) {
+ html = `
+${html}
+
`;
+ }
+ renderElement.querySelector("protyle-html").setAttribute("data-content", Lute.EscapeHTMLStr(html));
} else if (isInlineMemo) {
let inlineMemoElements;
if (updateElements) {
diff --git a/app/stage/protyle/js/protyle-html.js b/app/stage/protyle/js/protyle-html.js
index 6ba4edd53..972ddeae2 100644
--- a/app/stage/protyle/js/protyle-html.js
+++ b/app/stage/protyle/js/protyle-html.js
@@ -15,11 +15,7 @@ class ProtyleHtml extends HTMLElement {
if (name === 'data-content') {
const dataContent = Lute.UnEscapeHTMLStr(
this.getAttribute('data-content'))
- if (dataContent.startsWith('
${dataContent}
`
- }
+ this.display.innerHTML = dataContent
const el = document.createElement('div')
el.innerHTML = dataContent