MCPcopy Create free account
hub / github.com/71/logseq-snippets / DefineScriptBlock

Class DefineScriptBlock

script-block.js:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129class DefineScriptBlock extends HTMLElement {
130 constructor() {
131 super();
132
133 const name = this.getAttribute("name"),
134 body = this.innerHTML.slice(4, this.innerHTML.length - 3),
135 render = new Function("save", "html", "svg", body);
136
137 defineElement(name, ({ save, html, svg, ...state }) => render.call(state, save, html, svg));
138 }
139}
140
141customElements.define("script-block", ScriptBlock);
142customElements.define("define-script-block", DefineScriptBlock);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected