aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/paragraph.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-12 17:28:19 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-12 17:28:19 +0200
commit6dc2011d69c85820feddf6799142d304cc2eeb29 (patch)
tree29d8774a526631052ba6cd56be2492e5e249d494 /src/construct/paragraph.rs
parent1234de9c22343fc4e1fe9e3e1127d2db01e96c2f (diff)
downloadmarkdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.tar.gz
markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.tar.bz2
markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.zip
Refactor to improve entering
Diffstat (limited to '')
-rw-r--r--src/construct/paragraph.rs11
1 files changed, 9 insertions, 2 deletions
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)
}
}