diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-06-20 12:59:06 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-06-20 12:59:06 +0200 |
commit | 262aec96cece3e9dd55828397b8ec859e7cff606 (patch) | |
tree | 0024565a50902b67a2cc3088bd5c37c705116096 /src/subtokenize.rs | |
parent | 5bf187fab2df0122e51523d1c731e457ab366121 (diff) | |
download | markdown-rs-262aec96cece3e9dd55828397b8ec859e7cff606.tar.gz markdown-rs-262aec96cece3e9dd55828397b8ec859e7cff606.tar.bz2 markdown-rs-262aec96cece3e9dd55828397b8ec859e7cff606.zip |
Remove unneeded `content` content type
Diffstat (limited to '')
-rw-r--r-- | src/subtokenize.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/subtokenize.rs b/src/subtokenize.rs index 71a84e1..4a29a01 100644 --- a/src/subtokenize.rs +++ b/src/subtokenize.rs @@ -1,4 +1,4 @@ -use crate::content::{content::start as content, string::start as string, text::start as text}; +use crate::content::{string::start as string, text::start as text}; use crate::tokenizer::{ Code, Event, EventType, State, StateFn, StateFnResult, TokenType, Tokenizer, }; @@ -20,8 +20,7 @@ pub fn subtokenize(events: Vec<Event>, codes: &[Code]) -> (Vec<Event>, bool) { // Find each first opening chunk. if (event.token_type == TokenType::ChunkString - || event.token_type == TokenType::ChunkText - || event.token_type == TokenType::ChunkContent) && + || event.token_type == TokenType::ChunkText) && event.event_type == EventType::Enter && // No need to enter linked events again. event.previous == None @@ -33,9 +32,7 @@ pub fn subtokenize(events: Vec<Event>, codes: &[Code]) -> (Vec<Event>, bool) { let mut tokenizer = Tokenizer::new(event.point.clone(), event.index); // Substate. let mut result: StateFnResult = ( - State::Fn(Box::new(if event.token_type == TokenType::ChunkContent { - content - } else if event.token_type == TokenType::ChunkString { + State::Fn(Box::new(if event.token_type == TokenType::ChunkString { string } else { text |