1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Handle edge case for document numbering + tests

This commit is contained in:
Harvey Kandola 2018-06-09 19:13:38 +01:00
parent 0da8ae9e4a
commit 2e9734e73e
3 changed files with 30 additions and 2 deletions

View file

@ -23,7 +23,7 @@ func Numberize(pages []Page) {
for i, p := range pages {
// handle bad data
if p.Level == 0 {
if p.Level == 0 || (i == 0 && p.Level > 1) {
p.Level = 1
}