Merge 5881ef1f96
into e96880f42b
commit
62909ec4d5
4
block.go
4
block.go
|
@ -1054,8 +1054,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
|
||||
|
|
|
@ -836,6 +836,15 @@ func TestOrderedList(t *testing.T) {
|
|||
"* Start with unordered\n 1. Ordered\n",
|
||||
"<ul>\n<li>Start with unordered\n\n<ol>\n<li>Ordered</li>\n</ol></li>\n</ul>\n",
|
||||
|
||||
"random numbers:\n\n 3. Bird\n 1. McHale\n 8. Parish",
|
||||
"<p>random numbers:</p>\n\n<ol>\n<li>Bird</li>\n<li>McHale</li>\n<li>Parish</li>\n</ol>\n",
|
||||
|
||||
"big numbers should be skipped:\n\n 3. Bird\n 1. McHale\n 8. Parish\n\n 999. last element",
|
||||
"<p>big numbers should be skipped:</p>\n\n<ol>\n<li>Bird</li>\n<li>McHale</li>\n\n<li><p>Parish</p></li>\n\n<li><p>last element</p></li>\n</ol>\n",
|
||||
|
||||
"big numbers should be skipped:\n\n 3. Bird\n 1. McHale\n 8. Parish\n\n 2019. is the actual year",
|
||||
"<p>big numbers should be skipped:</p>\n\n<ol>\n<li>Bird</li>\n<li>McHale</li>\n<li>Parish</li>\n</ol>\n\n<p>2019. is the actual year</p>\n",
|
||||
|
||||
"1. numbers\n1. are ignored\n",
|
||||
"<ol>\n<li>numbers</li>\n<li>are ignored</li>\n</ol>\n",
|
||||
|
||||
|
|
Loading…
Reference in New Issue