feat(build): lower static fragments as safe html

Add a generated static_fragment helper for include_str!-style prototype fragments and use it in the v0 page assembly path so static lowered .heml no longer needs repeated SafeHtml::trusted plumbing.

req: dx/006

req: html_safety/001

req: html_safety/002

req: component/003
This commit is contained in:
slhx agent
2026-06-01 23:57:19 +02:00
parent eaa5479b42
commit bc7e7881b4
3 changed files with 12 additions and 6 deletions
+5 -5
View File
@@ -183,12 +183,12 @@ fn all_examples() -> SafeHtml {
// Static `.heml` fragments are lowered by generated code before they join rendered views.
// req: html_safety/001 req: html_safety/002 req: component/003
SafeHtml::join([
SafeHtml::trusted(counter::lower(include_str!("../templates/counter.heml"))),
SafeHtml::trusted(todos::lower(include_str!("../templates/todos.heml"))),
SafeHtml::trusted(wizard::lower(include_str!("../templates/wizard.heml"))),
SafeHtml::trusted(auth::lower(include_str!("../templates/auth.heml"))),
counter::static_fragment(include_str!("../templates/counter.heml")),
todos::static_fragment(include_str!("../templates/todos.heml")),
wizard::static_fragment(include_str!("../templates/wizard.heml")),
auth::static_fragment(include_str!("../templates/auth.heml")),
render_page_swap("Welcome", "Welcome"),
SafeHtml::trusted(notifications::lower(include_str!("../templates/notifications.heml"))),
notifications::static_fragment(include_str!("../templates/notifications.heml")),
])
}