diff --git a/demo/chains-of-thought/main.ts b/demo/chains-of-thought/main.ts
index 33b3ce4..be3b423 100644
--- a/demo/chains-of-thought/main.ts
+++ b/demo/chains-of-thought/main.ts
@@ -129,7 +129,7 @@ async function openFile(showPicker = true) {
try {
const text = await fileSaver.open(showPicker);
const json = JSON.parse(text || '{ "thoughts": [], "connections": [] }');
- main.innerHTML = renderChainOfThought(json);
+ main.setHTMLUnsafe(renderChainOfThought(json));
} catch (e) {
// No file handler was persisted or the file is invalid JSON.
console.error(e);
diff --git a/demo/src/record-player.ts b/demo/src/record-player.ts
index 17a9356..64fe9df 100644
--- a/demo/src/record-player.ts
+++ b/demo/src/record-player.ts
@@ -1,5 +1,5 @@
// Ported from https://github.com/bitu467/record-player
-import { css } from '../../src/common/tags';
+import { css, html } from '../../src/common/tags';
const styles = css`
::slotted(*) {
@@ -236,18 +236,17 @@ export class RecordPlayer extends HTMLElement {
const shadow = this.attachShadow({ mode: 'open' });
shadow.adoptedStyleSheets.push(styles);
- shadow.innerHTML = `
-
-
-
-
-
-
-
-
-
-
-`;
+ shadow.setHTMLUnsafe(html`
+
+
+
+
+
+
+
+
+
+ `);
this.#volumeInput = shadow.querySelector('input[type="range"]')!;
this.#volumeInput.addEventListener('input', this);
diff --git a/src/folk-llm.ts b/src/folk-llm.ts
index 0f38f77..1ecc477 100644
--- a/src/folk-llm.ts
+++ b/src/folk-llm.ts
@@ -91,7 +91,7 @@ export class FolkLLM extends HTMLElement {
const stream = await this.#session.promptStreaming(this.prompt);
for await (const chunk of stream) {
- this.#shadow.innerHTML = chunk;
+ this.#shadow.setHTMLUnsafe(chunk);
}
this.dispatchEvent(new Event('finished'));
diff --git a/src/folk-shape.ts b/src/folk-shape.ts
index d332ccc..11819a1 100644
--- a/src/folk-shape.ts
+++ b/src/folk-shape.ts
@@ -258,7 +258,7 @@ export class FolkShape extends HTMLElement {
// Ideally we would creating these lazily on first focus, but the resize handlers need to be around for delegate focus to work.
// Maybe can add the first resize handler here, and lazily instantiate the rest when needed?
// I can see it becoming important at scale
- this.#shadow.innerHTML = html`
+ this.#shadow.setHTMLUnsafe(html`
@@ -266,7 +266,7 @@ export class FolkShape extends HTMLElement {
-