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:
@@ -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")),
|
||||
])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user