repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
02bd8be
parent
ea2a492
author
Eric Bower
date
2022-08-15 13:18:12 +0000 UTC
fix(lists): nested parser sometimes would divide by zero
1 files changed,  +6, -1
M lists/parser.go
+6, -1
 1@@ -159,7 +159,12 @@ func parseItem(meta *MetaData, li *ListItem, prevItem *ListItem, pre bool, mod i
 2 			mod = old - len(trim)
 3 			li.Indent = 1
 4 		} else {
 5-			li.Indent = (old - len(trim)) / mod
 6+			numerator := old - len(trim)
 7+			if mod == 0 {
 8+				li.Indent = 1
 9+			} else {
10+				li.Indent = numerator / mod
11+			}
12 		}
13 	} else {
14 		li.IsText = true