mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 01:47:51 +08:00
pkg/md/fmt.go: Stop incrementing ordered list item's number at 9 9's.
This commit is contained in:
parent
8c0e2e17da
commit
a0d308d23c
|
@ -212,7 +212,12 @@ func (c *FmtCodec) Do(op Op) {
|
|||
}
|
||||
ct := c.containers.peek()
|
||||
ct.marker = ""
|
||||
ct.number++
|
||||
// If the current number is 9 9's, incrementing it will make the number
|
||||
// 10 digits; CommonMark requires the number in the ordered list to be
|
||||
// at most 9 digits. So just stop incrementing at this number.
|
||||
if ct.number < 999999999 {
|
||||
ct.number++
|
||||
}
|
||||
case OpBulletListStart:
|
||||
c.containers.push(&fmtContainer{
|
||||
typ: fmtBulletItem,
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
go test fuzz v1
|
||||
string("999999990)\n0)\n0)\n0)\n0)\n0)\n0)\n0)\n0)\n0)\n0)")
|
Loading…
Reference in New Issue
Block a user