diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-22 16:16:59 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-22 16:16:59 +0200 |
commit | 8774b207b7251730eaa7fbfe4f144122a472dda0 (patch) | |
tree | ce1b8f92a08ff70da265ae8e4484dba2335280a9 /src/tokenizer.rs | |
parent | 351c69644bdbdf52c95e322904273657892920b5 (diff) | |
download | markdown-rs-8774b207b7251730eaa7fbfe4f144122a472dda0.tar.gz markdown-rs-8774b207b7251730eaa7fbfe4f144122a472dda0.tar.bz2 markdown-rs-8774b207b7251730eaa7fbfe4f144122a472dda0.zip |
Add support for GFM task list item
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r-- | src/tokenizer.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs index 0bd1f31..731b829 100644 --- a/src/tokenizer.rs +++ b/src/tokenizer.rs @@ -144,6 +144,10 @@ pub struct TokenizeState<'a> { pub document_exits: Vec<Option<Vec<Event>>>, /// Whether the previous flow was a paragraph. pub document_paragraph_before: bool, + /// Whether this is the first paragraph (potentially after definitions) in + /// a list item. + /// Used for GFM task list items. + pub document_at_first_paragraph_of_list_item: bool, // Couple of very frequent settings for parsing whitespace. pub space_or_tab_eol_content: Option<Content>, @@ -282,6 +286,7 @@ impl<'a> Tokenizer<'a> { document_data_index: None, document_child_state: None, document_child: None, + document_at_first_paragraph_of_list_item: false, definitions: vec![], end: 0, label_starts: vec![], @@ -509,11 +514,6 @@ impl<'a> Tokenizer<'a> { /// Stack an attempt, moving to `ok` on [`State::Ok`][] and `nok` on /// [`State::Nok`][], reverting in both cases. pub fn check(&mut self, ok: State, nok: State) { - debug_assert_ne!( - nok, - State::Nok, - "checking w/ `State::Nok` should likely be an attempt" - ); // Always capture (and restore) when checking. // No need to capture (and restore) when `nok` is `State::Nok`, because the // parent attempt will do it. |