fix(runtime): support native user interactions
req: examples/005 req: form/002 req: convention/004 req: dx/008
This commit is contained in:
@@ -346,11 +346,16 @@ fn __slhx_lower_html(html: &str, table: &[(&str, &str, u32)]) -> ::std::string::
|
||||
}
|
||||
|
||||
fn __slhx_replace_attr(mut html: ::std::string::String, attr: &str, name: &str, runtime_attr: &str, id: u32) -> ::std::string::String {
|
||||
let replacement = ::std::format!("{runtime_attr}=\"{id}\"");
|
||||
let replacement = if runtime_attr == "value" {
|
||||
::std::format!("{attr}=\"{name}\" {runtime_attr}=\"{id}\"")
|
||||
} else {
|
||||
::std::format!("{runtime_attr}=\"{id}\"")
|
||||
};
|
||||
let double = ::std::format!("{attr}=\"{name}\"");
|
||||
html = html.replace(&double, &replacement);
|
||||
let single_replacement = replacement.replace('"', "'");
|
||||
let single = ::std::format!("{attr}='{name}'");
|
||||
html.replace(&single, &replacement)
|
||||
html.replace(&single, &single_replacement)
|
||||
}
|
||||
|
||||
fn __slhx_lower_static_attr(mut html: ::std::string::String, attr: &str, runtime_attr: &str) -> ::std::string::String {
|
||||
|
||||
Reference in New Issue
Block a user