Skip to content

On Windows, ManifestToEpub produces manifest and zip directory with backslash-separated paths #1

@cbutcosk

Description

@cbutcosk

Over at quire we've been tracking a bug with the use of epubjs-cli on Windows to package epub files. When packaging the epub manifest on windows, valid url-separator-paths in href properties on resources objects:

{
    "resources": [
        {
            "encodingFormat": "text/css",
            "url": "_assets/epub.css"
        },
        {
            "rel": "cover-image",
            "url": "_assets/images/static-cover.jpg"
        },
        {
            "url": "_assets/images/logo-getty.png"
        },
        {
            "url": "_assets/images/spiral-overlay.png"
        }
    ]
}

get Windows-style path separators when being packaged in to the package.opf file and when being inserted into the zip directory of the final .epub file:

    <item id="static-cover" href="_assets\images\static-cover.jpg" media-type="image/jpeg" properties="cover-image" />
    <item id="logo-getty" href="_assets\images\logo-getty.png" media-type="image/png" />
    <item id="spiral-overlay" href="_assets\images\spiral-overlay.png" media-type="image/png" /

I believe this is due to the usage of platform-specific path functions in epubjs-cli's ManifestToEpub. I've attached a reproduction test case (works in a VM as well) here:

epubjc-cli-test.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions