fix(build): lower rendered loop keys
req: list/002
This commit is contained in:
@@ -1072,6 +1072,7 @@ fn __hemx_lower_html(html: &str, table: &[(&str, &str, u32)]) -> ::std::string::
|
||||
out = __hemx_replace_attr(out, attr, name, runtime_attr, *id);
|
||||
}
|
||||
out = __hemx_lower_static_attr(out, "data-hemx-key", "data-key");
|
||||
out = __hemx_lower_static_attr(out, "h-key", "data-key");
|
||||
__hemx_inject_handle_inputs(out)
|
||||
}
|
||||
|
||||
@@ -4586,11 +4587,11 @@ mod hemplate {{
|
||||
}}
|
||||
{generated}
|
||||
fn main() {{
|
||||
let html = todo::lower_html(r#"<form data-hemx-handle="create"><input name="title"></form><li data-hemx-slot="row" data-hemx-key="7"></li>"#);
|
||||
let html = todo::lower_html(r#"<form data-hemx-handle="create"><input name="title"></form><li data-hemx-slot="row" h-key="7"></li>"#);
|
||||
assert!(html.contains(r#"data-hid="#));
|
||||
assert!(html.contains(r#"name="__h""#));
|
||||
assert!(html.contains(r#"data-key="7""#));
|
||||
assert!(!html.contains("data-hemx-key"));
|
||||
assert!(html.contains(r#"data-key="7""#)); // req: list/002 test
|
||||
assert!(!html.contains("h-key"));
|
||||
}}
|
||||
"###,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user