Skip to content

Cannot load images with space in filename #3182

@thgh

Description

@thgh

Problem is with getAbsoluteLocalPath which turns spaces in pathname into %20

const getAbsoluteLocalPath = (src: string) => {
if (BROWSER) {
throw new Error('Cannot check local paths in client-side environment');
}
const {
protocol,
auth,
host,
port,
hostname,
path: pathname,
} = url.parse(src);
const absolutePath = pathname ? path.resolve(pathname) : undefined;
if ((protocol && protocol !== 'file:') || auth || host || port || hostname) {
return undefined;
}
return absolutePath;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions