From 33b69eb9189fb2fd0f731530285baf3ac20c5eb0 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 22 Jun 2022 14:43:42 +0200 Subject: Refactor to improve tokenizer, add docs --- src/construct/paragraph.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/construct/paragraph.rs') diff --git a/src/construct/paragraph.rs b/src/construct/paragraph.rs index 8cd8d36..af5d85d 100644 --- a/src/construct/paragraph.rs +++ b/src/construct/paragraph.rs @@ -154,12 +154,14 @@ pub fn interrupt_indent(_tokenizer: &mut Tokenizer, code: Code) -> StateFnResult /// |
/// ``` pub fn interrupt_cont(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { - tokenizer.attempt_5( - blank_line, - code_fenced, - html_flow, - heading_atx, - thematic_break, + tokenizer.attempt_n( + vec![ + Box::new(blank_line), + Box::new(code_fenced), + Box::new(html_flow), + Box::new(heading_atx), + Box::new(thematic_break), + ], |ok| Box::new(move |_t, code| (if ok { State::Nok } else { State::Ok }, Some(vec![code]))), )(tokenizer, code) } -- cgit