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/heading_atx.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/heading_atx.rs')
-rw-r--r-- | src/construct/heading_atx.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/construct/heading_atx.rs b/src/construct/heading_atx.rs index f75805a..22b93db 100644 --- a/src/construct/heading_atx.rs +++ b/src/construct/heading_atx.rs @@ -56,7 +56,7 @@ use crate::constant::{HEADING_ATX_OPENING_FENCE_SIZE_MAX, TAB_SIZE}; use crate::construct::partial_space_or_tab::{space_or_tab, space_or_tab_min_max}; -use crate::event::{Content, Event, Kind, Name}; +use crate::event::{Content, Event, Kind, Link, Name}; use crate::resolve::Name as ResolveName; use crate::state::{Name as StateName, State}; use crate::tokenizer::Tokenizer; @@ -157,7 +157,14 @@ pub fn at_break(tokenizer: &mut Tokenizer) -> State { State::Retry(StateName::HeadingAtxSequenceFurther) } Some(_) => { - tokenizer.enter_with_content(Name::Data, Some(Content::Text)); + tokenizer.enter_link( + Name::Data, + Link { + previous: None, + next: None, + content: Content::Text, + }, + ); State::Retry(StateName::HeadingAtxData) } } |