import attachScript from "../lib/attachScript"; import Html from "../lib/html"; import Notebook from "../notebook"; const renderer = { html(raw: string) { const html = Html.fromString(raw); if (html && html.tagName === "SCRIPT") { const attrs = html.getAttrs(); if (attrs.showCode !== undefined) { const div = document.createElement("div"); div.innerHTML = `
${raw}`;
const code = div.querySelector("code") as HTMLElement;
code.textContent = raw;
return div.innerHTML;
}
}
return false;
},
};
const after = async (
notebook: Notebook,
root: any,
options: any
): Promise