chyingp / grunt-inline

Brings externally referenced resources, such as js, css and images, into a single file.
MIT License
87 stars 55 forks source link

Won't inline urls from css properties #55

Open fuddl opened 9 years ago

fuddl commented 9 years ago

It seems its not supposed to work to inline images also from css properties like:

<style>
   #foo { background-image: url('bar.jpg?__inline=true'); }
</style>

Is that the case?

fuddl commented 9 years ago

I managed to do this with a little hack.

the regex for this looks like that:

fileContent.replace(/url\(["']*([^)'"]+)["']*\)/g, function(matchedWord, imgUrl) { });
marcusklaas commented 9 years ago

Would you consider opening a pull request for this, @fuddl?

lucianoratamero commented 7 years ago

for now, if you want this solved, use my fork:

npm install "git+https://git@github.com/lucianoratamero/grunt-inline.git#feature/css-url-replacing"

I'm opening a PR to fix this :)

tpanningnextcen commented 7 years ago

@lucianoratamero I used your code, but didn't see your pull request in this repo. Did you submit it? I found your fix very useful.