aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct/heading_atx.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2023-05-18 17:01:26 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2023-05-18 17:01:26 +0200
commit35cbee9ede93fbf9296357765cab0e23698bfb22 (patch)
tree485713b1f9c4c5c62e1a38dc63d3bdab97829204 /src/construct/heading_atx.rs
parent7340a46b5c7fdb05796377d8c73c4843b6ae2876 (diff)
downloadmarkdown-rs-35cbee9ede93fbf9296357765cab0e23698bfb22.tar.gz
markdown-rs-35cbee9ede93fbf9296357765cab0e23698bfb22.tar.bz2
markdown-rs-35cbee9ede93fbf9296357765cab0e23698bfb22.zip
Remove unneeded branch
Diffstat (limited to 'src/construct/heading_atx.rs')
-rw-r--r--src/construct/heading_atx.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/construct/heading_atx.rs b/src/construct/heading_atx.rs
index 05b7c86..33b14a7 100644
--- a/src/construct/heading_atx.rs
+++ b/src/construct/heading_atx.rs
@@ -129,15 +129,10 @@ pub fn sequence_open(tokenizer: &mut Tokenizer) -> State {
State::Next(StateName::HeadingAtxSequenceOpen)
}
// Always at least one `#`.
- else if matches!(tokenizer.current, None | Some(b'\n')) {
+ else if matches!(tokenizer.current, None | Some(b'\t' | b'\n' | b' ')) {
tokenizer.tokenize_state.size = 0;
tokenizer.exit(Name::HeadingAtxSequence);
State::Retry(StateName::HeadingAtxAtBreak)
- } else if matches!(tokenizer.current, Some(b'\t' | b' ')) {
- tokenizer.tokenize_state.size = 0;
- tokenizer.exit(Name::HeadingAtxSequence);
- tokenizer.attempt(State::Next(StateName::HeadingAtxAtBreak), State::Nok);
- State::Retry(space_or_tab(tokenizer))
} else {
tokenizer.tokenize_state.size = 0;
State::Nok