MCPcopy Index your code
hub / github.com/pyscript/pyscript / replaceScript

Function replaceScript

core/src/plugins/py-editor.js:163–175  ·  view source on GitHub ↗
(script, type)

Source from the content-addressed store, hash-verified

161}
162
163const replaceScript = (script, type) => {
164 script.xworker?.terminate();
165 const clone = script.cloneNode(true);
166 clone.type = `${type}-editor`;
167 const editor = editors.get(script);
168 if (editor) {
169 const content = editor.state.doc.toString();
170 clone.textContent = content;
171 editors.delete(script);
172 script.nextElementSibling.remove();
173 }
174 script.replaceWith(clone);
175};
176
177const makeRunButton = (handler, type) => {
178 const runButton = document.createElement("button");

Callers 1

makeRunButtonFunction · 0.85

Calls 4

toStringMethod · 0.80
getMethod · 0.45
deleteMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected