Styling expansion
Widen the :styling slot grammar so banner / footer authors can lay out text — motivated by centering a footer item, which is impossible today. Add harmless structural tags (center, p, div, hr, ul, ol, li, code, small, sup, sub) and the text-align CSS property to *styling-policy* in lisp/public-pages.lisp — the entire engine change is one defparameter; the authoritative pass derives from the policy. Headings stay out (the banner h1 wrapper pops open on a heading start tag in full-document parse but nests in the SPA fragment parse — same markup, different DOM per surface). Both <center> and text-align: the tag is what the admin actually types, the property covers right / justify. New grammar is a strict superset, so old rows and the read-side belt are unaffected; re-save a row to use the new tags. Grammar probes + idempotence cases in tests/styling-tests.lisp, one doc line in model-reference.md.
Plan: styling-expansion-plan.org
Implemented as specified. lisp/public-pages.lisp: *styling-policy* gained the eleven structural tags (center / p / div / hr / ul / ol / li / code / small / sup / sub), each with the ("style" "class") attribute shape (hr included, br keeps none), and "text-align" in :allowed-css-properties; styling-tag-action's docstring count went six → seventeen. Nothing else in the engine moved — styling-allowed-attrs, the CSS value filter, and the authoritative walk all derive from the policy. Deviation (one docstring beyond the plan's "nothing else changes"): styling-pass's docstring cited <div><script>…</script></div> as its probe-verified nested-unwrap example, stale now that div is kept — swapped to <b><script>…</script></b> (library-alone probe: the <script> element survives pass one intact; the walk is what kills it), the same move the plan makes for the test pin. tests/styling-tests.lisp (probe-first; every new expectation pinned to the live sanitizer's answer, and the plan's open (d) question answered by probe: script inside a kept tag drops with content — <div></div>, not unwrap-to-text): the five div-riding pins rewritten for the kept div (href and CDATA cases gain their wrapper, <div><b>x</b></div> keeps both levels), the load-bearing nested-unwrap pin moved to <b><script>alert(1)</script></b> with its comment, new structural probes (all eleven tags, <hr> void serialization <hr>, class-kept / onclick-dropped on <ul>, <h2> unwraps — the heading fence), text-align filter cases in the style section, seven new *sty-test-cases* fixed-point inputs for the read-side belt. docs/model-reference.md: the :styling paragraph's tag enumeration and style property clause updated (the built-in-types table row untouched). Live-verified in the browser on both surfaces of the dev image (todos model — test-model, which the suite run left loaded, publishes nothing): footer centering, the motivating case, measured exactly centered on /p/ (409/409 side margins on a 953px box) and the SPA (389/389, full-width .app-footer); <hr> and <ul> render (disc markers); the banner's <div style"font-size: 0.7em">= block child renders on both surfaces with the style applied, and the /p/ "Open in app" nav stayed on the banner's flex line; the <span> control renders as before; no console errors; no npm run build (no web/ change — the SPA renders the new tags from stored HTML). Screenshots unavailable (desktop window hidden) — verified by DOM geometry instead. Eyeball rows deleted after; the dev image now serves todos with no styling rows. (run-styling-tests) green (182 checks). Full suite green (3724 checks, 56 groups).
- Slot
- 5700
- Status
- 60 Done
- Tags
- backend, frontend, model, polish
- Contributors
- Donnie
- Plans
- Styling expansion