A world-class math input for the web
at main 13 lines 435 B view raw
1import { createCaretVDOMComponent, h } from "@caret-js/core"; 2import { fractionTokenType } from "../tokens/fraction"; 3 4export const FractionTokenComponent = createCaretVDOMComponent< 5 typeof fractionTokenType 6>(({ token, children }) => { 7 return h( 8 "span", 9 { class: "fraction" }, 10 h("span", { class: "numerator" }, children.get("numerator")), 11 h("span", { class: "denominator" }, children.get("denominator")), 12 ); 13});