diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-10 13:44:09 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-10 13:44:09 +0200 |
commit | 30e5f806277d14d5dcab708ccd0ce07a4894c1f9 (patch) | |
tree | 6a7ab8f589c9144b4efcd7ec66b12913e0d16fdc /src/construct/list.rs | |
parent | 29e08c059addb2529637613f7122c573cfc46f6a (diff) | |
download | markdown-rs-30e5f806277d14d5dcab708ccd0ce07a4894c1f9.tar.gz markdown-rs-30e5f806277d14d5dcab708ccd0ce07a4894c1f9.tar.bz2 markdown-rs-30e5f806277d14d5dcab708ccd0ce07a4894c1f9.zip |
Refactor some code for document parsing
Diffstat (limited to 'src/construct/list.rs')
-rw-r--r-- | src/construct/list.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/construct/list.rs b/src/construct/list.rs index 36c1dac..d726c73 100644 --- a/src/construct/list.rs +++ b/src/construct/list.rs @@ -275,7 +275,9 @@ pub fn after(tokenizer: &mut Tokenizer) -> State { prefix += 1; } - let container = tokenizer.container.as_mut().unwrap(); + let container = &mut tokenizer.tokenize_state.document_container_stack + [tokenizer.tokenize_state.document_continued]; + container.blank_initial = blank; container.size = prefix; @@ -309,7 +311,8 @@ pub fn cont_start(tokenizer: &mut Tokenizer) -> State { /// | b /// ``` pub fn cont_blank(tokenizer: &mut Tokenizer) -> State { - let container = tokenizer.container.as_ref().unwrap(); + let container = &mut tokenizer.tokenize_state.document_container_stack + [tokenizer.tokenize_state.document_continued]; let size = container.size; if container.blank_initial { @@ -329,7 +332,8 @@ pub fn cont_blank(tokenizer: &mut Tokenizer) -> State { /// ^ /// ``` pub fn cont_filled(tokenizer: &mut Tokenizer) -> State { - let container = tokenizer.container.as_mut().unwrap(); + let container = &mut tokenizer.tokenize_state.document_container_stack + [tokenizer.tokenize_state.document_continued]; let size = container.size; container.blank_initial = false; |