aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-22 14:43:42 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-22 14:43:42 +0200
commit33b69eb9189fb2fd0f731530285baf3ac20c5eb0 (patch)
treefb4ad9ad645192b67f01b4727136d0a298b71909 /src/construct
parent0fcfeaf05a95ea17763a72d91b6aa1c01843d067 (diff)
downloadmarkdown-rs-33b69eb9189fb2fd0f731530285baf3ac20c5eb0.tar.gz
markdown-rs-33b69eb9189fb2fd0f731530285baf3ac20c5eb0.tar.bz2
markdown-rs-33b69eb9189fb2fd0f731530285baf3ac20c5eb0.zip
Refactor to improve tokenizer, add docs
Diffstat (limited to 'src/construct')
-rw-r--r--src/construct/paragraph.rs14
1 files changed, 8 insertions, 6 deletions
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
/// |<div>
/// ```
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)
}