import assert from "node:assert/strict";
import test from "node:test";
import { DEFAULT_STYLE } from "./constants.ts";
import {
buildCss,
buildHtmlDocument,
modifyHtmlStructure,
normalizeCssText,
normalizeInlineCss,
removeFirstHeading,
} from "./html-builder.ts";
test("buildCss injects style variables and concatenates base and theme CSS", () => {
const css = buildCss("body { color: red; }", ".theme { color: blue; }");
assert.match(css, /--md-primary-color: #0F4C81;/);
assert.match(css, /body \{ color: red; \}/);
assert.match(css, /\.theme \{ color: blue; \}/);
});
test("buildHtmlDocument includes optional meta tags and code theme CSS", () => {
const html = buildHtmlDocument(
{
title: "Doc",
author: "Baoyu",
description: "Summary",
},
"body { color: red; }",
"
Intro
Intro