diff --git a/block.go b/block.go index 45c21a6c..4e8779f8 100644 --- a/block.go +++ b/block.go @@ -1051,8 +1051,8 @@ func (p *parser) oliPrefix(data []byte) int { i++ } - // we need >= 1 digits followed by a dot and a space - if start == i || data[i] != '.' || data[i+1] != ' ' { + // we need 1,2 or 3 digits followed by a dot and a space + if start == i || start < i-3 || data[i] != '.' || data[i+1] != ' ' { return 0 } return i + 2 diff --git a/block_test.go b/block_test.go index 820fe890..e9d99cd6 100644 --- a/block_test.go +++ b/block_test.go @@ -836,6 +836,15 @@ func TestOrderedList(t *testing.T) { "* Start with unordered\n 1. Ordered\n", "
random numbers:
\n\nbig numbers should be skipped:
\n\nParish
last element
big numbers should be skipped:
\n\n2019. is the actual year
\n", + "1. numbers\n1. are ignored\n", "