Support counter set in plain list items.

This commit is contained in:
Tom Alexander 2023-09-06 19:09:20 -04:00
parent 6fc607cfe0
commit f8b99ed235
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,2 @@
3. [@3] foo
4. bar

View File

@ -735,6 +735,8 @@ fn compare_plain_list_item<'s>(
contents_status, contents_status,
)?); )?);
// TODO: compare :bullet :checkbox :counter :pre-blank
Ok(DiffResult { Ok(DiffResult {
status: this_status, status: this_status,
name: emacs_name.to_owned(), name: emacs_name.to_owned(),

View File

@ -147,6 +147,11 @@ pub fn plain_list_item<'b, 'g, 'r, 's>(
Into::<&str>::into(bull) != "*" || indent_level > 0 Into::<&str>::into(bull) != "*" || indent_level > 0
})(remaining)?; })(remaining)?;
let (remaining, _maybe_counter_set) =
opt(tuple((space1, tag("[@"), counter, tag("]"))))(remaining)?;
// TODO: parse checkbox
let (remaining, maybe_tag) = opt(tuple(( let (remaining, maybe_tag) = opt(tuple((
space1, space1,
parser_with_context!(item_tag)(context), parser_with_context!(item_tag)(context),