~erock/pico

02bd8bed0fff38564fbfdf7adb5d92114cdb421c — Eric Bower a month ago ea2a492 pre-imgs
fix(lists): nested parser sometimes would divide by zero
1 files changed, 6 insertions(+), 1 deletions(-)

M lists/parser.go
M lists/parser.go => lists/parser.go +6 -1
@@ 159,7 159,12 @@ func parseItem(meta *MetaData, li *ListItem, prevItem *ListItem, pre bool, mod i
			mod = old - len(trim)
			li.Indent = 1
		} else {
			li.Indent = (old - len(trim)) / mod
			numerator := old - len(trim)
			if mod == 0 {
				li.Indent = 1
			} else {
				li.Indent = numerator / mod
			}
		}
	} else {
		li.IsText = true