fix: uncommited function

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-04-02 12:34:26 -03:00
parent 09f8aa5480
commit 7aa12c170d

View File

@@ -60,3 +60,13 @@ where
}
None
}
pub fn extract_text<'a>(node: &'a comrak::nodes::AstNode<'a>) -> String {
let text = RefCell::new(String::new());
let _ = iter_nodes(node, &|node| {
if let NodeValue::Text(t) = &node.data.borrow().value {
text.borrow_mut().push_str(&t);
}
});
let r = text.borrow().to_string();
r
}