aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-12 17:03:14 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-12 17:03:14 +0200
commit037fb65633edaad1a75a707eee7c223471d7fb00 (patch)
tree0d26f2fefd383755901ecc64494df33a9b9f9a5b /src
parent6ba11bdaca1721fb4591819604c340d147798f45 (diff)
downloadmarkdown-rs-037fb65633edaad1a75a707eee7c223471d7fb00.tar.gz
markdown-rs-037fb65633edaad1a75a707eee7c223471d7fb00.tar.bz2
markdown-rs-037fb65633edaad1a75a707eee7c223471d7fb00.zip
Remove unneeded state
Diffstat (limited to 'src')
-rw-r--r--src/construct/code_fenced.rs25
-rw-r--r--src/state.rs2
2 files changed, 4 insertions, 23 deletions
diff --git a/src/construct/code_fenced.rs b/src/construct/code_fenced.rs
index e69f33c..56a2a04 100644
--- a/src/construct/code_fenced.rs
+++ b/src/construct/code_fenced.rs
@@ -331,27 +331,10 @@ pub fn at_non_lazy_break(tokenizer: &mut Tokenizer) -> State {
State::Next(StateName::CodeFencedAfter),
State::Next(StateName::CodeFencedContentBefore),
);
- State::Retry(StateName::CodeFencedCloseBefore)
-}
-
-/// Before closing fence, at eol.
-///
-/// ```markdown
-/// | ~~~js
-/// > | console.log(1)
-/// ^
-/// | ~~~
-/// ```
-pub fn close_before(tokenizer: &mut Tokenizer) -> State {
- match tokenizer.current {
- Some(b'\n') => {
- tokenizer.enter(Name::LineEnding);
- tokenizer.consume();
- tokenizer.exit(Name::LineEnding);
- State::Next(StateName::CodeFencedCloseStart)
- }
- _ => unreachable!("expected eol"),
- }
+ tokenizer.enter(Name::LineEnding);
+ tokenizer.consume();
+ tokenizer.exit(Name::LineEnding);
+ State::Next(StateName::CodeFencedCloseStart)
}
/// Before closing fence, at optional whitespace.
diff --git a/src/state.rs b/src/state.rs
index 01530c7..006ffe1 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -59,7 +59,6 @@ pub enum Name {
CodeFencedMetaBefore,
CodeFencedMeta,
CodeFencedAtNonLazyBreak,
- CodeFencedCloseBefore,
CodeFencedCloseStart,
CodeFencedBeforeSequenceClose,
CodeFencedSequenceClose,
@@ -341,7 +340,6 @@ pub fn call(tokenizer: &mut Tokenizer, name: Name) -> State {
Name::CodeFencedMetaBefore => construct::code_fenced::meta_before,
Name::CodeFencedMeta => construct::code_fenced::meta,
Name::CodeFencedAtNonLazyBreak => construct::code_fenced::at_non_lazy_break,
- Name::CodeFencedCloseBefore => construct::code_fenced::close_before,
Name::CodeFencedCloseStart => construct::code_fenced::close_start,
Name::CodeFencedBeforeSequenceClose => construct::code_fenced::before_sequence_close,
Name::CodeFencedSequenceClose => construct::code_fenced::sequence_close,