Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dpurge opened this issue Oct 14, 2024 · 1 comment

Comments

@dpurge
Copy link

dpurge commented Oct 14, 2024

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))
@neclepsio
Copy link

I just was hit by the same bug.
I fixed it using path.Join instead of filepath.Join.

neclepsio added a commit to neclepsio/go-epub that referenced this issue Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants