feat: add todo_type method in Headline

This commit is contained in:
PoiScript 2023-11-20 01:46:13 +08:00
parent c432d335f1
commit 2f64e1e6af
No known key found for this signature in database
GPG key ID: 22C2B1249D99985E
7 changed files with 69 additions and 32 deletions

View file

@ -23,7 +23,7 @@ assert_eq!(
HEADLINE@0..18
HEADLINE_STARS@0..1 "*"
WHITESPACE@1..2 " "
HEADLINE_KEYWORD@2..6 "DONE"
HEADLINE_KEYWORD_DONE@2..6 "DONE"
WHITESPACE@6..7 " "
HEADLINE_TITLE@7..13
TEXT@7..13 "Title "
@ -46,7 +46,7 @@ let config = ParseConfig {
};
let org = config.parse("* TASK Title 1");
let hdl = org.first_node::<Headline>().unwrap();
assert_eq!(hdl.keyword().unwrap().text(), "TASK");
assert_eq!(hdl.todo_keyword().unwrap().text(), "TASK");
```
## Render to html