laxman954 / granule

Automatically exported from code.google.com/p/granule
0 stars 0 forks source link

Minor bug with URL rewriting in CSS #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a some CSS that looks like this:

@font-face {
    font-family: 'AdelleBasicBold';
    src: url('/stylesheets/adellebasic_bold-adelle.eot');
}

Note that the url begins with a slash and so should be considered relative to 
the app root (not the location of the css file which is /stylesheets).

The generated url should remain unchanged in this situation, however the 
generated css looks like this:

@font-face {
    font-family: 'AdelleBasicBold';
    src: url(stylesheets/stylesheets/adellebasic_bold-adelle.eot);
}

What version of the product are you using? On what operating system?
    1.0.9, on win xp, with google app engine version 1.6.0

Please provide any additional information below.
    I have a work-around so I don't need a fix, I just wanted to help you out. This project is awesome! Keep up the good work and thanks for writing it!

Original issue reported on code.google.com by m...@mattburns.co.uk on 9 Nov 2011 at 2:34

GoogleCodeExporter commented 8 years ago
Not sure why this is described as "minor".  This library looked attractive 
until I saw this bug listed. This is a complete deal breaker for being able to 
use it with many existing libraries or adopting it in large existing 
applications.  Any library that combines CSS must first and foremost properly 
rewrite all embedded urls be they relative, server-relative, or absolute.

Original comment by Jwadam...@gmail.com on 17 Nov 2011 at 3:45

GoogleCodeExporter commented 8 years ago
I wrote the description, I'm just someone that uses this library. I consider 
the bug "minor" because I imagine it is pretty easy to fix, and it is also 
pretty easy to work around.

For me, it was easy to change my original css to relative urls. Hackier 
solutions would be to add url redirection, duplicated resources or even 
post-processing the files to correct them.

Of course the best solution is to check out the code, find the bug, and offer 
the guy a patch for your fix...

Original comment by m...@mattburns.co.uk on 18 Nov 2011 at 11:39

GoogleCodeExporter commented 8 years ago
Fixed this issue.

Get the code from :
https://github.com/sasidhar/Granule/tree/css-images-path-fix

Original comment by sasidha...@imaginea.com on 19 Dec 2012 at 7:24