Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip away the relative path #482

Merged
merged 1 commit into from
Nov 22, 2021
Merged

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Nov 19, 2021

Fixes #478

Previously having this css:

src: url(./fontawesome/fa-brands-400.eot);

would be transformed into:

src: url(/./fontawesome/fa-brands-400.eot);

This strips off the unnecessary ./ so it will be:

src: url(/fontawesome/fa-brands-400.eot);

@jcoyne
Copy link
Contributor Author

jcoyne commented Nov 19, 2021

@chuchiperriman does this solve your issue? It wasn't entirely clear to me the situation you had given the description for #478

@dhh
Copy link
Member

dhh commented Nov 22, 2021

I think the problem was also with fully relative paths, like: src: url(fontawesome/fa-brands-400.eot). What actually is the right thing for us to do then? I think that too has to be converted to /fontawesome/fa-brands-400.eot.

@jcoyne
Copy link
Contributor Author

jcoyne commented Nov 22, 2021

@dhh I have the same question. I added a test for the current behavior for that case here: https:/rails/sprockets-rails/pull/482/files#diff-8226e061e1adf779cb31d000395d5c814bc94696f12b25fa4ac7cb8acb9ee555R58-R63 I don't know if that's the right behavior though.

@dhh
Copy link
Member

dhh commented Nov 22, 2021

Other option is to truly let it be relative. But don't know if we have all the info for the sprockets processor to do that?

@dhh
Copy link
Member

dhh commented Nov 22, 2021

Anyway, this at least fixes the direct breakage.

@dhh dhh merged commit 05dbab2 into rails:master Nov 22, 2021
@jcoyne jcoyne deleted the handle-relative-path branch November 22, 2021 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect relative URL in css
2 participants