aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 13:32:32 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-13 13:32:32 +0200
commit645fb2b02b1563bd98c07515bdc2d6d8478ba74e (patch)
tree239bf35cc5ba6560d1f19344c24ec8a1aebe882f /src
parent02ac7c7a69fc7949912a266f3cfc40f7c219278e (diff)
downloadmarkdown-rs-645fb2b02b1563bd98c07515bdc2d6d8478ba74e.tar.gz
markdown-rs-645fb2b02b1563bd98c07515bdc2d6d8478ba74e.tar.bz2
markdown-rs-645fb2b02b1563bd98c07515bdc2d6d8478ba74e.zip
Add a bunch more tests for frontmatter
Diffstat (limited to '')
-rw-r--r--src/construct/frontmatter.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/construct/frontmatter.rs b/src/construct/frontmatter.rs
index 268d91d..f4774d6 100644
--- a/src/construct/frontmatter.rs
+++ b/src/construct/frontmatter.rs
@@ -281,13 +281,10 @@ pub fn content_end(tokenizer: &mut Tokenizer) -> State {
/// ^
/// ```
pub fn after(tokenizer: &mut Tokenizer) -> State {
- tokenizer.tokenize_state.marker = 0;
-
- match tokenizer.current {
- None | Some(b'\n') => {
- tokenizer.exit(Name::Frontmatter);
- State::Ok
- }
- _ => State::Nok,
- }
+ debug_assert!(
+ matches!(tokenizer.current, None | Some(b'\n')),
+ "expected eol/eof after closing fence"
+ );
+ tokenizer.exit(Name::Frontmatter);
+ State::Ok
}