mailparser icon indicating copy to clipboard operation
mailparser copied to clipboard

img src which are missing a protocol scheme

Open mgrant0 opened this issue 3 years ago • 0 comments

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!

mgrant0 avatar Jan 30 '22 16:01 mgrant0