diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 17:28:19 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-12 17:28:19 +0200 |
commit | 6dc2011d69c85820feddf6799142d304cc2eeb29 (patch) | |
tree | 29d8774a526631052ba6cd56be2492e5e249d494 /src/construct/partial_label.rs | |
parent | 1234de9c22343fc4e1fe9e3e1127d2db01e96c2f (diff) | |
download | markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.tar.gz markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.tar.bz2 markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.zip |
Refactor to improve entering
Diffstat (limited to 'src/construct/partial_label.rs')
-rw-r--r-- | src/construct/partial_label.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/construct/partial_label.rs b/src/construct/partial_label.rs index a1667e1..20a7b15 100644 --- a/src/construct/partial_label.rs +++ b/src/construct/partial_label.rs @@ -60,7 +60,7 @@ use crate::constant::LINK_REFERENCE_SIZE_MAX; use crate::construct::partial_space_or_tab_eol::{space_or_tab_eol_with_options, Options}; -use crate::event::{Content, Name}; +use crate::event::{Content, Link, Name}; use crate::state::{Name as StateName, State}; use crate::subtokenize::link; use crate::tokenizer::Tokenizer; @@ -110,7 +110,7 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { State::Retry(space_or_tab_eol_with_options( tokenizer, Options { - content_type: Some(Content::String), + content: Some(Content::String), connect: tokenizer.tokenize_state.connect, }, )) @@ -127,7 +127,14 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { State::Ok } _ => { - tokenizer.enter_with_content(Name::Data, Some(Content::String)); + tokenizer.enter_link( + Name::Data, + Link { + previous: None, + next: None, + content: Content::String, + }, + ); if tokenizer.tokenize_state.connect { let index = tokenizer.events.len() - 1; |