bump dependencies #79

Merged
Anri merged 3 commits from bump into main 2024-10-22 12:05:38 +02:00
Showing only changes of commit 8bf1be32fe - Show all commits

View file

@ -230,8 +230,10 @@ fn fix_images_and_integration(path: &str, html: &str) -> (String, Metadata) {
mail_obfsucated: false,
};
(
rewrite_str(
// Collection of any additional metadata
let mut additional_metadata = Vec::new();
let result = rewrite_str(
html,
RewriteStrSettings {
element_content_handlers: vec![element!("img", |el| {
@ -252,24 +254,29 @@ fn fix_images_and_integration(path: &str, html: &str) -> (String, Metadata) {
Some(options),
);
el.replace(&data.content, ContentType::Html);
metadata.merge(&data.metadata);
// Store the metadata for later merging
additional_metadata.push(data.metadata);
} else {
let image = general_purpose::STANDARD.encode(file);
el.set_attribute("src", &format!("data:{mime};base64,{image}"))
.unwrap();
}
}
}
Ok(())
})],
..RewriteStrSettings::default()
},
)
.unwrap(),
metadata,
)
.unwrap();
// Merge all collected metadata
for additional in additional_metadata {
metadata.merge(&additional);
}
(result, metadata)
}
/// Transform markdown string to File structure