Vanessa 2024-05-11 17:05:56 +08:00
parent 30b0f69dff
commit e04c8ff0b9
2 changed files with 47 additions and 45 deletions

View file

@ -995,7 +995,7 @@ export class Toolbar {
/// #endif
const textElement = this.subElement.querySelector(".b3-text-field") as HTMLTextAreaElement;
if (types.includes("NodeHTMLBlock")) {
textElement.value = renderElement.querySelector("protyle-html").getAttribute("data-content") || "";
textElement.value = Lute.UnEscapeHTMLStr(renderElement.querySelector("protyle-html").getAttribute("data-content") || "");
} else if (isInlineMemo) {
textElement.value = Lute.UnEscapeHTMLStr(renderElement.getAttribute("data-inline-memo-content") || "");
} else {

View file

@ -7,6 +7,8 @@ class ProtyleHtml extends HTMLElement {
super()
const shadowRoot = this.attachShadow({mode: 'open'})
this.display = this.shadowRoot
// https://github.com/siyuan-note/siyuan/issues/11321
this.setAttribute('data-content', Lute.EscapeHTMLStr(this.getAttribute('data-content')))
const dataContent = this.getAttribute('data-content')
this.display.innerHTML = dataContent
}