diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-26 12:39:38 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-26 12:39:38 +0200 |
commit | 297784cb925b1196d89479fa24c898703ae598d6 (patch) | |
tree | fcf620504c74e723d4897f6b208f076f24e211f4 /src/subtokenize.rs | |
parent | c998a346a342655e0a39136bc0490f810c0f95fb (diff) | |
download | markdown-rs-297784cb925b1196d89479fa24c898703ae598d6.tar.gz markdown-rs-297784cb925b1196d89479fa24c898703ae598d6.tar.bz2 markdown-rs-297784cb925b1196d89479fa24c898703ae598d6.zip |
Refactor to simplify tokenizer
Diffstat (limited to 'src/subtokenize.rs')
-rw-r--r-- | src/subtokenize.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs index a1ec90a..8aa4df1 100644 --- a/src/subtokenize.rs +++ b/src/subtokenize.rs @@ -100,16 +100,13 @@ pub fn subtokenize(events: &mut Vec<Event>, parse_state: &ParseState) -> bool { _ => unreachable!("cannot be ok/nok"), }; - state = tokenizer.push( - enter.point.index, - events[index + 1].point.index, - func, - link_curr.next == None, - ); + state = tokenizer.push(enter.point.index, events[index + 1].point.index, func); link_index = link_curr.next; } + tokenizer.flush(state, true); + // Now, loop through all subevents to figure out which parts // belong where and fix deep links. let mut subindex = 0; |