JSFiddle - React, Tailwind, and code Playground

by Josh Pullen

JavaScript

import { html, render } from "https://unpkg.com/htm/preact/standalone.module.js";

const code = 'return html`<span style=${{ color: "blue" }}>Hello, world!</span>`;';

const blob = new Blob([`export default function(html) { return { Question() { ${code} } } }`], { type: "text/javascript" });
const url = URL.createObjectURL(blob);

/* const fakeHtml = (...args) => args;
const result = JSON.parse(JSON.stringify(myCode(fakeHtml)));

const parsed = html(...result);

console.log(result, parsed);

render(parsed, document.body); */