From 8b760f53a04099f40fb4aa83757e8007e4d0811b Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Mon, 3 Aug 2026 21:49:07 +0530 Subject: [PATCH] fix: resolve 4 bugs in Editron --- editron-starters/json-server/index.js | 2 +- .../1-basics/1-introduction/1-welcome/_files/counter.js | 2 +- editron-starters/tutorialkit/src/templates/default/counter.js | 2 +- modules/playground/components/playground-editor.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editron-starters/json-server/index.js b/editron-starters/json-server/index.js index 79f6d7c0..ff5d944d 100644 --- a/editron-starters/json-server/index.js +++ b/editron-starters/json-server/index.js @@ -4,7 +4,7 @@ fetch(url) .then((r) => r.json()) .then( (json) => - (document.getElementById('output').innerHTML = JSON.stringify( + (document.getElementById('output').textContent = JSON.stringify( json, null, 2 diff --git a/editron-starters/tutorialkit/src/content/tutorial/1-basics/1-introduction/1-welcome/_files/counter.js b/editron-starters/tutorialkit/src/content/tutorial/1-basics/1-introduction/1-welcome/_files/counter.js index 7bcab393..6729acbe 100644 --- a/editron-starters/tutorialkit/src/content/tutorial/1-basics/1-introduction/1-welcome/_files/counter.js +++ b/editron-starters/tutorialkit/src/content/tutorial/1-basics/1-introduction/1-welcome/_files/counter.js @@ -3,7 +3,7 @@ export function setupCounter(element) { const setCounter = (count) => { counter = count; - element.innerHTML = `count is ${counter}`; + element.textContent = `count is ${counter}`; }; setCounter(0); diff --git a/editron-starters/tutorialkit/src/templates/default/counter.js b/editron-starters/tutorialkit/src/templates/default/counter.js index ef9ac5cc..622f6b04 100644 --- a/editron-starters/tutorialkit/src/templates/default/counter.js +++ b/editron-starters/tutorialkit/src/templates/default/counter.js @@ -3,7 +3,7 @@ export function setupCounter(element) { const setCounter = (count) => { counter = count; - element.innerHTML = `count is ${counter}`; + element.textContent = `count is ${counter}`; }; element.addEventListener('click', () => setCounter(counter + 1)); diff --git a/modules/playground/components/playground-editor.tsx b/modules/playground/components/playground-editor.tsx index 1434060a..3dcb2320 100644 --- a/modules/playground/components/playground-editor.tsx +++ b/modules/playground/components/playground-editor.tsx @@ -388,7 +388,7 @@ const PlaygroundEditor = ({ `; } } - styleEl.innerHTML = css; + styleEl.textContent = css; }; provider.awareness.on("update", handleAwarenessUpdate);