go-epub icon indicating copy to clipboard operation
go-epub copied to clipboard

AddSubSection fails on Windows because path separator is not matched in navAppender and ncxAppender

Open dpurge opened this issue 1 year ago • 1 comments
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))

dpurge avatar Oct 14 '24 22:10 dpurge