This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use std::borrow::Borrow;
|
||||
|
||||
use comrak::nodes::AstNode;
|
||||
use comrak::nodes::NodeValue;
|
||||
use comrak::nodes::{AstNode, NodeTaskItem, NodeValue};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct TaskGroup {
|
||||
@@ -46,7 +45,7 @@ impl Task {
|
||||
for child in node.children() {
|
||||
let child_data_ref = child.data.borrow();
|
||||
let t = match &child_data_ref.borrow().value {
|
||||
NodeValue::Text(contents) => contents.clone(),
|
||||
NodeValue::Text(contents) => contents.to_string(),
|
||||
NodeValue::Emph if child.first_child().is_some() => {
|
||||
format!("*{}*", Self::extract_text(child.first_child().unwrap())?)
|
||||
}
|
||||
@@ -101,8 +100,14 @@ impl<'a> TryFrom<&'a AstNode<'a>> for Task {
|
||||
.ok_or(TaskError::ParsingError("No childern of node found"))?,
|
||||
)?;
|
||||
let status = match ch {
|
||||
Some(c) if c == 'x' || c == 'X' => Status::Done(c),
|
||||
Some(c) => Status::Todo(c),
|
||||
NodeTaskItem {
|
||||
symbol: Some(c),
|
||||
symbol_sourcepos: _,
|
||||
} if c == 'x' || c == 'X' => Status::Done(c),
|
||||
NodeTaskItem {
|
||||
symbol: Some(c),
|
||||
symbol_sourcepos: _,
|
||||
} => Status::Todo(c),
|
||||
_ => Status::Empty,
|
||||
};
|
||||
let subtasks = node
|
||||
|
||||
Reference in New Issue
Block a user