jrit / web-resource-inliner

Inlines img, script and link tags into the same file
MIT License
69 stars 30 forks source link

minor patch: first check if given src is already a data uri #39

Closed tommedema closed 6 years ago

tommedema commented 6 years ago

This just makes a lot more sense, and does not affect tests. It doesn't make sense that it first checked if the settings.relativeTo is absolute, because this is not necessarily related to the given src. It might be that a data: uri source is passed while the general settings have an absolute relativeTo path.

tommedema commented 6 years ago

Note that I didn't add a new test because there is already a test for data-uris. This is just a logic improvement that's already tested for.

@jrit I also have a few other bugfixes coming up. I'll include test cases there because they solve failing tests. Should I just keep them coming like I have been doing so far or do you prefer if I work on my own branch for the coming weeks and share it with you once I feel like it's more stable?

There are quite a lot of bugs, for example currently on master branch whenever you provide a html file that includes a link with an absolute source, and that css file has a background image with a relative source, it will not resolve correctly. This is very easy to reproduce and I'm working on a fix.

tommedema commented 6 years ago

Will move this to another PR for now.