server: poll for new messages and update clients via WS

This commit is contained in:
2025-04-15 11:48:06 -07:00
parent 0662e6230e
commit 6f93aa4f34
10 changed files with 77 additions and 46 deletions

View File

@@ -445,19 +445,16 @@ pub fn sanitize_html(
let mut element_content_handlers = vec![
// Remove width and height attributes on elements
element!("[width],[height]", |el| {
println!("width or height {el:?}");
el.remove_attribute("width");
el.remove_attribute("height");
Ok(())
}),
// Remove width and height values from inline styles
element!("[style]", |el| {
println!("style {el:?}");
let style = el.get_attribute("style").unwrap();
let style = style
.split(";")
.filter(|s| {
println!("s {s}");
let Some((k, _)) = s.split_once(':') else {
return true;
};
@@ -469,7 +466,6 @@ pub fn sanitize_html(
})
.collect::<Vec<_>>()
.join(";");
println!("style: {style}");
if let Err(e) = el.set_attribute("style", &style) {
error!("Failed to set style attribute: {e}");
}