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

img src which are missing a protocol scheme #310

Open
mgrant0 opened this issue Jan 30, 2022 · 0 comments
Open

img src which are missing a protocol scheme #310

mgrant0 opened this issue Jan 30, 2022 · 0 comments

Comments

@mgrant0
Copy link

mgrant0 commented Jan 30, 2022

I'm using mailparser to grab the html from an email and then create an image using puppeteer. With URLs that are missing the 'http://' or 'https://' protocol scheme, the image doesn't load.

For example:

<img src="192.168.69.91/foo.jpg" border=0 /> 

I could regex through the resulting html after mailparser returned the html but this is messy. Could this be done inside mailparser as it tries to expand the html? Maybe some option to provide a default scheme for URLs missing a scheme? Or some way to provide a callback function which I could write a function to modify the URL?

Other suggestions to fix this greatly appreciated!

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

1 participant