diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 13:45:24 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-08-11 13:45:24 +0200 |
commit | 6eb2f644057f371841fe25330a57ee185f91c7af (patch) | |
tree | 7b4d02586339d1a7f82104b4473d9ac243b3abf9 /src/construct/attention.rs | |
parent | 2d35cbfceace81a217cd0fbdae7a8777c7a6465e (diff) | |
download | markdown-rs-6eb2f644057f371841fe25330a57ee185f91c7af.tar.gz markdown-rs-6eb2f644057f371841fe25330a57ee185f91c7af.tar.bz2 markdown-rs-6eb2f644057f371841fe25330a57ee185f91c7af.zip |
Refactor to move some code to `state.rs`
Diffstat (limited to '')
-rw-r--r-- | src/construct/attention.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/construct/attention.rs b/src/construct/attention.rs index d61813d..7e873ca 100644 --- a/src/construct/attention.rs +++ b/src/construct/attention.rs @@ -51,8 +51,9 @@ //! [html-em]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-em-element //! [html-strong]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-strong-element +use crate::state::{Name, State}; use crate::token::Token; -use crate::tokenizer::{Event, EventType, Point, State, StateName, Tokenizer}; +use crate::tokenizer::{Event, EventType, Point, Tokenizer}; use crate::unicode::PUNCTUATION; use crate::util::slice::Slice; @@ -120,7 +121,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State { Some(b'*' | b'_') if tokenizer.parse_state.constructs.attention => { tokenizer.tokenize_state.marker = tokenizer.current.unwrap(); tokenizer.enter(Token::AttentionSequence); - State::Retry(StateName::AttentionInside) + State::Retry(Name::AttentionInside) } _ => State::Nok, } @@ -136,7 +137,7 @@ pub fn inside(tokenizer: &mut Tokenizer) -> State { match tokenizer.current { Some(b'*' | b'_') if tokenizer.current.unwrap() == tokenizer.tokenize_state.marker => { tokenizer.consume(); - State::Next(StateName::AttentionInside) + State::Next(Name::AttentionInside) } _ => { tokenizer.exit(Token::AttentionSequence); |