This commit is contained in:
JMARyA 2025-01-15 18:53:55 +01:00
parent ed739d792f
commit e9a9dad037
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
19 changed files with 278 additions and 177 deletions

View file

@ -17,7 +17,7 @@ pub struct LinkWidget(Box<dyn UIWidget>, String, HashMap<String, String>);
impl AttrExtendable for LinkWidget {
fn add_attr(mut self, key: &str, val: &str) -> Self {
self.2.insert(key.to_string(), val.to_string());
self.2.insert(key.to_string(), val.replace('\'', "\\'"));
self
}
@ -67,6 +67,7 @@ impl UIWidget for LinkWidget {
impl LinkWidget {
/// Enable HTMX link capabilities
#[must_use]
pub fn use_htmx(self) -> Self {
let url = self.1.clone();
self.hx_get(&url)