Skip to content

Commit

Permalink
fix: misplaced subsection position in toc.ncx (go-shiori#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengShusss committed Oct 16, 2023
1 parent 8f86fba commit 4124542
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toc.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (t *toc) addSubSection(parent string, index int, title string, relativePath
},
Children: nil,
}
if parentNcxIndex > len(t.ncxXML.NavMap) {
if len(t.ncxXML.NavMap) > parentNcxIndex {
if t.ncxXML.NavMap[parentNcxIndex].Children == nil {
n := make([]tocNcxNavPoint, 0)
t.ncxXML.NavMap[parentNcxIndex].Children = &n
Expand Down

0 comments on commit 4124542

Please sign in to comment.