go-epub
go-epub copied to clipboard
AddSubSection fails on Windows because path separator is not matched in navAppender and ncxAppender
trafficstars
In toc.go line 177 there is a parentRelativePath variable created which is then used in navAppender and ncxAppender to find a parent section.
It does not work on Windows because of backslash path separator - parent is not found, error parent section not found is returned and the subsections are not added to the navigation.
It works fine when this line is changed to:
// parentRelativePath := filepath.Join(xhtmlFolderName, parent)
parentRelativePath := filepath.ToSlash(filepath.Join(xhtmlFolderName, parent))