feat(core): join safe html fragments
Let already-safe fragments compose without downgrading to String, and use it in the v0 page assembly example to keep rendered and lowered fragments typed at the boundary. req: html_safety/001 req: html_safety/002 req: component/003
This commit is contained in:
@@ -93,6 +93,18 @@ fn slot_html_requires_explicit_safe_html() {
|
||||
assert_eq!(payload, Payload::Html(String::from("<strong>ok</strong>")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn safe_html_joins_only_explicit_safe_fragments() {
|
||||
// req: html_safety/001 req: html_safety/002
|
||||
let html = SafeHtml::join([
|
||||
SafeHtml::trusted("<main>"),
|
||||
SafeHtml::trusted("<strong>ok</strong>"),
|
||||
SafeHtml::trusted("</main>"),
|
||||
]);
|
||||
|
||||
assert_eq!(html.as_str(), "<main><strong>ok</strong></main>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn param_names_format_generated_param_names() {
|
||||
// req: codegen/003
|
||||
|
||||
Reference in New Issue
Block a user