From 6dc2011d69c85820feddf6799142d304cc2eeb29 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 12 Aug 2022 17:28:19 +0200 Subject: Refactor to improve entering --- src/construct/paragraph.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/construct/paragraph.rs') diff --git a/src/construct/paragraph.rs b/src/construct/paragraph.rs index c956a2c..e9fd377 100644 --- a/src/construct/paragraph.rs +++ b/src/construct/paragraph.rs @@ -32,7 +32,7 @@ //! [code_text]: crate::construct::code_text //! [html]: https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element -use crate::event::{Content, Kind, Name}; +use crate::event::{Content, Kind, Link, Name}; use crate::resolve::Name as ResolveName; use crate::state::{Name as StateName, State}; use crate::tokenizer::Tokenizer; @@ -49,7 +49,14 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { None | Some(b'\n') => unreachable!("unexpected eol/eof"), _ => { tokenizer.enter(Name::Paragraph); - 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::ParagraphInside) } } -- cgit