web-resource-inliner icon indicating copy to clipboard operation
web-resource-inliner copied to clipboard

Images in `srcset` should be included too

Open marijnvdwerf opened this issue 9 years ago • 3 comments

Expected: Image with both src and srcset has both images included

<img src="/images/logo.png" srcset="/images/[email protected] 2x" />

Actual: Image only has src included as data URI. srcset is left unchanged

marijnvdwerf avatar Aug 10 '15 16:08 marijnvdwerf

@jrit in addition to the above, favicons and fonts are also not embedded; do you plan to do this or welcome a PR for this? should there be config to enable/disable types of assets?

tommedema avatar Oct 01 '17 13:10 tommedema

@tommedema I'd welcome a PR, but don't plan to add that myself. My preference would be a config similar to how the existing configs work per asset type, and with a similar rationale for defaults.

jrit avatar Oct 01 '17 23:10 jrit

@jrit if I ever get to this in the future, do you think that the current logic should be refactored to have a single detection and replacement engine in which differences for each type can be injected?

Currently the code is not very DRY, which is already apparent from a glance at the code:

screen shot 2017-12-23 at 13 18 55

This could be rewritten to 1 block of logic and 4 configuration entries. Wdyt?

tommedema avatar Dec 23 '17 05:12 tommedema