jrit / web-resource-inliner

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

How to deal with svg fill urls? #38

Open tommedema opened 6 years ago

tommedema commented 6 years ago

I'm not an expert on svgs, but apparently the fill attribute can have anchors that are referencing to svg definitions like so:

screen shot 2017-12-23 at 16 28 24

In this case the given url should not be embedded, since it is a reference rather than something you can base64 encode. Right? What's your take on this?

jrit commented 6 years ago

I think you might be a level deeper on SVGs than I had considered. The docs around SVG are focused on inlining SVG files into HTML content, rather than inlining the content within SVGs. In any case, my understanding (which could be wrong) is that if one wanted to inline that reference, they could and the datatype would be data:image/svg+xml but nobody has ever actually requested this as a feature so my inclination is that it would be more practical if this is causing you a problem to open a PR to exclude hashes from url inlining rather than add support for inlining SVG within SVG.