aboutsummaryrefslogtreecommitdiffstats
path: root/src/construct
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-14 19:28:36 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-14 19:28:36 +0200
commit5a98a4626d4e87c4681f7f2434bbc56c90bad322 (patch)
treea9e03d4d26cba5dc534767877bab7c1c5b247f80 /src/construct
parentf3371fc97016a6012433319c46f3945fbfaeb9fc (diff)
downloadmarkdown-rs-5a98a4626d4e87c4681f7f2434bbc56c90bad322.tar.gz
markdown-rs-5a98a4626d4e87c4681f7f2434bbc56c90bad322.tar.bz2
markdown-rs-5a98a4626d4e87c4681f7f2434bbc56c90bad322.zip
Fix interrupting sibling list items
Diffstat (limited to '')
-rw-r--r--src/construct/list.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/construct/list.rs b/src/construct/list.rs
index bab821c..6614122 100644
--- a/src/construct/list.rs
+++ b/src/construct/list.rs
@@ -112,10 +112,9 @@ fn before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
Box::new(if ok { nok } else { before_unordered })
})(tokenizer, code),
// Ordered.
- Code::Char(char) if char.is_ascii_digit() => {
+ Code::Char(char) if char.is_ascii_digit() && (!tokenizer.interrupt || char == '1') => {
tokenizer.enter(Token::ListItemPrefix);
tokenizer.enter(Token::ListItemValue);
- // To do: `interrupt || !1`?
inside(tokenizer, code, 0)
}
_ => (State::Nok, None),
@@ -271,7 +270,6 @@ pub fn blank_cont(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
// We have a blank line.
// Still, try to consume at most the items size.
- // To do: eat at most `size` whitespace.
tokenizer.go(space_or_tab_min_max(0, size), cont_after)(tokenizer, code)
}