mirror of
https://github.com/documize/community.git
synced 2025-07-25 16:19:46 +02:00
improvements to numbering logic edge case detection
This commit is contained in:
parent
a13b631a7e
commit
049b83e0b9
1 changed files with 7 additions and 2 deletions
|
@ -34,7 +34,10 @@ func Numberize(pages []Page) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.Level == prevPageLevel {
|
if p.Level == prevPageLevel {
|
||||||
parts[len(parts)-1]++
|
j := len(parts) - 1
|
||||||
|
if j >= 0 {
|
||||||
|
parts[j]++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.Level < prevPageLevel {
|
if p.Level < prevPageLevel {
|
||||||
|
@ -48,7 +51,9 @@ func Numberize(pages []Page) {
|
||||||
if i < 0 {
|
if i < 0 {
|
||||||
i = 0
|
i = 0
|
||||||
}
|
}
|
||||||
parts[i]++
|
if i >= 0 && i < len(parts) {
|
||||||
|
parts[i]++
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue