Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Nick: fixed include tags bug

Nicolas7fdecdc4d37b
diff --git a/apps/api/sharedLibs/html-transformer/src/lib.rs b/apps/api/sharedLibs/html-transformer/src/lib.rs
index 702c69e48..f4a96c359 100644
--- a/apps/api/sharedLibs/html-transformer/src/lib.rs
+++ b/apps/api/sharedLibs/html-transformer/src/lib.rs
@@ -221,7 +221,8 @@ fn _transform_html_inner(opts: TranformHTMLOptions) -> Result<String, ()> {
let root = new_document.select_first("div")?;
for x in opts.include_tags.iter() {
- for tag in document.select(x)? {
+ let matching_nodes: Vec<_> = document.select(x)?.collect();
+ for tag in matching_nodes {
root.as_node().append(tag.as_node().clone());
}
}