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

Relative URLs inside zipped (contained) epub #28

Closed
panurge-ws opened this issue Jul 21, 2013 · 1 comment
Closed

Relative URLs inside zipped (contained) epub #28

panurge-ws opened this issue Jul 21, 2013 · 1 comment

Comments

@panurge-ws
Copy link

In some epubs there are relative links to resources and css as ../Styles/Style.css.
In this way, those resources are not loaded because the URL searched is not valid.

A possibile solution is: inside Renderer replace the "../" inside the url parsers:

EPUBJS.Renderer.prototype.replaceHead
EPUBJS.Renderer.prototype.replaceResources

resources.forEach(function(link){
        var src = link.getAttribute("href"),
            src = src.replace("../",""), 
            full = this.book.settings.contentsPath + src;
@fchasen
Copy link
Contributor

fchasen commented Jul 28, 2013

Updated to use EPUBJS.core.resolveUrl(base, path)

@fchasen fchasen closed this as completed Jul 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants