import { expect, test } from "bun:test"; import { renderRichText, richTextSchema } from "../src/rich-text.ts"; test("semantic text is escaped, bounded, and rejects arbitrary markup properties", () => { expect( renderRichText({ text: "\nworld", richText: [ { text: "", bold: true }, { text: "\nworld", italic: true, underline: true }, ], }), ).toBe("<hello>
world
"); expect(richTextSchema.parse([{ text: "hello", html: "