import { marked } from 'marked'; /** * renderOfferHtml renders the public-offer markdown source into a standalone, * self-contained HTML document served at `/offer/`. It runs server-side in the * render sidecar (`renderer/src/offer.mjs`), which reads the owner-edited * `ui/legal/offer_ru.md`, splices the live catalog price list into it and calls * this function — one renderer shared with the browser build, kept unit-tested * here (`offer.test.ts`). * * The input `markdown` is trusted repository content plus the backend's own * catalog projection, not user input, so the rendered HTML is deliberately not * sanitised. The page carries its own minimal light/dark styling so it needs * neither the app bundle nor `app.css`. */ export function renderOfferHtml(markdown: string): string { const body = marked.parse(markdown, { async: false }) as string; return ` Публичная оферта — Эрудит
${body}
`; }