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

[BUG] Unable to embed image from some sites like sspai.com #401

Open
xjmwx4 opened this issue Nov 3, 2024 · 5 comments
Open

[BUG] Unable to embed image from some sites like sspai.com #401

xjmwx4 opened this issue Nov 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@xjmwx4
Copy link

xjmwx4 commented Nov 3, 2024

Unable to embed image from some sites like sspai.com.

@xjmwx4 xjmwx4 added the bug Something isn't working label Nov 3, 2024
@maoserr
Copy link
Owner

maoserr commented Nov 3, 2024

hmm, interesting bug, looks like src is getting truncated for some reason

@maoserr
Copy link
Owner

maoserr commented Nov 3, 2024

This bug is not related to my code, it appears to be a bug with the Chrome built in dom parser. The source string contains the correct src field, but the parsed dom contains the wrong src field afterwards. I won't be able to fix something like this.

let parser = new DOMParser();
let dom = parser.parseFromString(source, "text/html");

@maoserr maoserr closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2024
@xjmwx4
Copy link
Author

xjmwx4 commented Nov 6, 2024

This bug is not related to my code, it appears to be a bug with the Chrome built in dom parser. The source string contains the correct src field, but the parsed dom contains the wrong src field afterwards. I won't be able to fix something like this.这个错误与我的代码无关,它似乎是 Chrome 浏览器内置 dom 解析器的一个错误。源字符串包含正确的 src 字段,但解析后的 dom 却包含错误的 src 字段。我无法修复这样的问题。

let parser = new DOMParser();
let dom = parser.parseFromString(source, "text/html");

this project can effectively embed image from the sites I mentioned.

Demo web: https://webpagetoepub.github.io/

@maoserr
Copy link
Owner

maoserr commented Nov 6, 2024

hmm, that is true, I'll check it out. The link you provided does not contain the original source code however, it's been minified.

@maoserr maoserr reopened this Nov 6, 2024
@maoserr
Copy link
Owner

maoserr commented Nov 9, 2024

images are webp images. Epubs don't support webp as far as I know. I'll leave this open in case in the future I'll add a webp to png converter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants