documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Windows paths with spaces don't work with datauri #44

Closed triemstr closed 14 years ago

triemstr commented 14 years ago

Embedding images with datauri doesn't work when you have a windows path with spaces.

Here's an example, with embed_assets set at 'datauri', run jammit. On one of my files (base-datauri.css), I find this inside

background:url(EMBEDC:/Documents and Settings/username/My Documents/Website/public/images/embed/bg_body_int.png)

When I move the code to C:\code, and run jammit, I get the embedded binary image.

It's possible this is a relatively easy fix...delimiting or putting path in quotes so long as that doesn't screw up other platforms. There's also no error message stating the embedded function did not work.

Workaround: Move code to non-spaced path.

triemstr commented 14 years ago

EMBED actually has two underscores to either side in the example above.

documentcloud commented 14 years ago

I've relaxed the regex that we were using to re-write data-URIs. It should now be good for windows paths with spaces. Check out Jammit's master branch and give it a spin if you have a minute. Closing the ticket.