mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
30b0f69dff
commit
e04c8ff0b9
2 changed files with 47 additions and 45 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
8
app/stage/protyle/js/protyle-html.js
vendored
8
app/stage/protyle/js/protyle-html.js
vendored
|
|
@ -3,19 +3,21 @@
|
|||
//# sourceMappingURL=purify.min.js.map
|
||||
|
||||
class ProtyleHtml extends HTMLElement {
|
||||
constructor () {
|
||||
constructor() {
|
||||
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
|
||||
}
|
||||
|
||||
static get observedAttributes () {
|
||||
static get observedAttributes() {
|
||||
return ['data-content']
|
||||
}
|
||||
|
||||
attributeChangedCallback (name, oldValue, newValue) {
|
||||
attributeChangedCallback(name, oldValue, newValue) {
|
||||
if (name === 'data-content') {
|
||||
let dataContent = Lute.UnEscapeHTMLStr(this.getAttribute('data-content'))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue