Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


font-url fails with URLs that contain ? or # in production #3045

shaicoleman opened this Issue · 9 comments

8 participants


The font-url method doesn't properly handle URLs that use the FontSpring syntax, e.g. the ones produced from FontSquirrel.
src: font-url('aller_rg-webfont.eot?#iefix') format('embedded-opentype'),

The following URLs aren't parsed correctly as they have ? or # afterwards. This is needed to work around handle IE7/8 issues and for older iOS browsers.

sass-rails delegates url generation to rails, so this is not an issue with sass-rails.
See rails/sass-rails#49


@jj05 can you confirm if this is working in Rails 3.2 using 3-2-stable branch + sass-rails 3-2-stable branch?.
The issue was closed in sass-rails


I've pushed rails/sass-rails@68536e3 and 439d340 too. Please comment again on the ticket if you still has issues

@spastorino spastorino closed this

I tested this with a fresh minimal rails app (ruby 1.9.3p194, rails 3.2.9, sass-rails 3.2.5) and I can confirm that it's still not working.

The following scss

.test1a {
  content: image-url("testimage.png");

.test1b {
  content: image-url("testimage.png#iefix");

.test2a {
  content: font-url("testfont.eot");

.test2b {
  content: font-url("testfont.eot#foo");



I committed a fix for this (franzk/rails@bd279d9) - but it will break things for assets that truly contain # or ? in their paths. Another option is the following workaround which clearly defines what is path and what is appendix:

.test2b {
  content: url(unquote("#{font-path('testfont.eot')}#foo"));

Can you push the test app to github please?

@steveklabnik steveklabnik reopened this
@franzk franzk referenced this issue from a commit in franzk/rails
franzk Minimal changes to reproduce rails/rails#3045 543a075

I have pushed a branch test-app-for-fix-asset-path-appendix to my rails fork.


Is this still an with Rails 4.0.0.beta1?


@franzk From the output you pasted, assets that truly contain a ? or # in them are already broken (in that stamping isn't applied to them).

I think the odds that anyone is doing this in practice is effectively zero.

@leafac leafac referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.

I updated the test Rails app to reproduce this issue against the current master and it works.

The app.

The Sass.

The compiled CSS.

I think this issue can be closed now.


@leafac thank you for test this!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.