fix: uncommited function
This commit is contained in:
10
src/utils.rs
10
src/utils.rs
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user