moved to comrak 0.52
All checks were successful
Test / test (push) Successful in 47s

This commit is contained in:
2026-04-14 22:05:31 -04:00
parent 181be6c4e3
commit ce03c9c171
6 changed files with 599 additions and 51 deletions

View File

@@ -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