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:
parent
0da8ae9e4a
commit
2e9734e73e
3 changed files with 30 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue