fix(core): keep unset values visible in prose (#12)

renderText now leaves {{name}} in place when the value is empty, so prose
shows which parameter is still missing instead of a blank.
This commit is contained in:
Florian Schmidt
2026-11-16 12:31:54 +01:00
parent 276d6ef3ca
commit 382da1736f
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -153,6 +153,8 @@ describe("rendering and secrets", () => {
it("renders prose with raw values and handles inherited names safely", () => {
const n = book(" x: {type: string}");
expect(renderText("{{x}} {{toString}}", { x: "a & b" }, n)).toBe("a & b {{toString}}");
// An unset value stays visible as its template instead of vanishing ("on ****").
expect(renderText("on **{{x}}**", { x: "" }, n)).toBe("on **{{x}}**");
expect(render(n, {}, {}).invalid.x).toBeUndefined();
expect(render(n, {}, {}).missing).toContain("x");
});