diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-05 13:31:46 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-05 13:31:46 +0200 |
commit | f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef (patch) | |
tree | b2a837d99cb0e4a4de0bfd82051e10a2db8c6456 /src/construct/label_end.rs | |
parent | fd860a975b84da9a79abfa247787e6adbd5ea34c (diff) | |
download | markdown-rs-f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef.tar.gz markdown-rs-f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef.tar.bz2 markdown-rs-f2d62d446a7b1e03ef14b580e2aca0fad8aa23ef.zip |
Refactor to do some to dos
Diffstat (limited to 'src/construct/label_end.rs')
-rw-r--r-- | src/construct/label_end.rs | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/construct/label_end.rs b/src/construct/label_end.rs index 6f747db..24ac3a5 100644 --- a/src/construct/label_end.rs +++ b/src/construct/label_end.rs @@ -531,9 +531,7 @@ fn nok(tokenizer: &mut Tokenizer, _code: Code, label_start_index: usize) -> Stat .label_start_stack .get_mut(label_start_index) .unwrap(); - println!("just balanced braces: {:?}", label_start); label_start.balanced = true; - // To do: pop things off the list? (State::Nok, None) } @@ -708,22 +706,19 @@ fn full_reference_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult } } - // Always found, otherwise we don’t get here. - let start = start.unwrap(); - let end = end.unwrap(); - - let id = normalize_identifier(&serialize( - &tokenizer.parse_state.codes, - &Span { - start_index: start, - end_index: end, - }, - false, - )); - let defined = tokenizer.parse_state.definitions.contains(&id); - // To do: set `id` on the media somehow? - - if defined { + if tokenizer + .parse_state + .definitions + .contains(&normalize_identifier(&serialize( + &tokenizer.parse_state.codes, + &Span { + // Always found, otherwise we don’t get here. + start_index: start.unwrap(), + end_index: end.unwrap(), + }, + false, + ))) + { (State::Ok, Some(vec![code])) } else { (State::Nok, None) |