aboutsummaryrefslogtreecommitdiffstats
path: root/src/subtokenize.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/subtokenize.rs
parent1234de9c22343fc4e1fe9e3e1127d2db01e96c2f (diff)
downloadmarkdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.tar.gz
markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.tar.bz2
markdown-rs-6dc2011d69c85820feddf6799142d304cc2eeb29.zip
Refactor to improve entering
Diffstat (limited to 'src/subtokenize.rs')
-rw-r--r--src/subtokenize.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs
index 432c198..f55c790 100644
--- a/src/subtokenize.rs
+++ b/src/subtokenize.rs
@@ -9,7 +9,7 @@
//! * …must occur on [`Enter`][Kind::Enter] events only
//! * …must occur on void events (they are followed by their corresponding
//! [`Exit`][Kind::Exit] event)
-//! * …must have `content_type` field to define the kind of subcontent
+//! * …must have `link` field
//!
//! Links will then be passed through a tokenizer for the corresponding content
//! type by `subtokenize`.
@@ -53,8 +53,8 @@ pub fn link_to(events: &mut [Event], pevious: usize, next: usize) {
link_next.previous = Some(pevious);
debug_assert_eq!(
- events[pevious].link.as_ref().unwrap().content_type,
- events[next].link.as_ref().unwrap().content_type
+ events[pevious].link.as_ref().unwrap().content,
+ events[next].link.as_ref().unwrap().content
);
}
@@ -80,7 +80,7 @@ pub fn subtokenize(events: &mut Vec<Event>, parse_state: &ParseState) -> bool {
// Subtokenizer.
let mut tokenizer = Tokenizer::new(event.point.clone(), parse_state);
// Substate.
- let mut state = State::Next(if link.content_type == Content::String {
+ let mut state = State::Next(if link.content == Content::String {
StateName::StringStart
} else {
StateName::TextStart