aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/construct/list.rs12
-rw-r--r--tests/commonmark.rs21
2 files changed, 17 insertions, 16 deletions
diff --git a/src/construct/list.rs b/src/construct/list.rs
index 4eb9797..c2007e6 100644
--- a/src/construct/list.rs
+++ b/src/construct/list.rs
@@ -184,14 +184,16 @@ fn before_unordered(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult {
/// > | 1. a
/// ^
/// ```
-fn inside(tokenizer: &mut Tokenizer, code: Code, mut size: usize) -> StateFnResult {
- size += 1;
+fn inside(tokenizer: &mut Tokenizer, code: Code, size: usize) -> StateFnResult {
match code {
- Code::Char(char) if char.is_ascii_digit() && size < LIST_ITEM_VALUE_SIZE_MAX => {
+ Code::Char(char) if char.is_ascii_digit() && size + 1 < LIST_ITEM_VALUE_SIZE_MAX => {
tokenizer.consume(code);
- (State::Fn(Box::new(move |t, c| inside(t, c, size))), None)
+ (
+ State::Fn(Box::new(move |t, c| inside(t, c, size + 1))),
+ None,
+ )
}
- Code::Char('.' | ')') => {
+ Code::Char('.' | ')') if !tokenizer.interrupt || size < 2 => {
tokenizer.exit(Token::ListItemValue);
marker(tokenizer, code)
}
diff --git a/tests/commonmark.rs b/tests/commonmark.rs
index 1843a51..1734004 100644
--- a/tests/commonmark.rs
+++ b/tests/commonmark.rs
@@ -999,7 +999,7 @@ of dashes"/>
r###"Setext headings (91)"###
);
-// To do: some interruption bug.
+// To do: lazy setext underline bug.
// assert_eq!(
// micromark_with_options(r###"> foo
// bar
@@ -3913,16 +3913,15 @@ baz</li>
r###"Lists (302)"###
);
- // To do: Some interruption bug.
- // assert_eq!(
- // micromark_with_options(r###"The number of windows in my house is
- // 14. The number of doors is 6.
- // "###, DANGER),
- // r###"<p>The number of windows in my house is
- // 14. The number of doors is 6.</p>
- // "###,
- // r###"Lists (303)"###
- // );
+ assert_eq!(
+ micromark_with_options(r###"The number of windows in my house is
+14. The number of doors is 6.
+"###, DANGER),
+ r###"<p>The number of windows in my house is
+14. The number of doors is 6.</p>
+"###,
+ r###"Lists (303)"###
+);
assert_eq!(
micromark_with_options(r###"The number of windows in my house is