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

data-uri does not accept fragment only value in URLs #2320

Closed
BarakChamo opened this issue Dec 2, 2014 · 4 comments
Closed

data-uri does not accept fragment only value in URLs #2320

BarakChamo opened this issue Dec 2, 2014 · 4 comments

Comments

@BarakChamo
Copy link

This is an existing issue relevant to this closed issue.
#1959

The generated url is incorrect if a reference is made to an inline SVG and not an external file:

CSS (in folder 'components'):

path.nv-line {
    marker-mid: url('#line-marker');
}

Inline SVG:

<defs>
    <marker id="line-marker">
         <circle cx="6" cy="6" r="5"></circle>
    </marker>
</defs>

The URI generated:

 'components/#line-marker'

An example of using inline SVG references

@seven-phases-max
Copy link
Member

Isn't this related more to the --relative-urls option than to data-uri? (Your code does not have any data-uri function call at all, does it?).

P.S. I've also answered at the corresponding SO topic.

@BarakChamo
Copy link
Author

Hi @seven-phases-max ,

I guess you're right about data-uris being unrelated, I mixed things up.

Still, relativeUrls: false was set for rendering the less files, which would be the same as not having the flag? Also, toggling it to true and false didn't seem to have any effect.

Thanks for answering in on SO as well!

As I mentioned there, having the references in the root folder seems to work around the issue but anywhere else would still prepend the path.

@seven-phases-max
Copy link
Member

Also, toggling it to true and false didn't seem to have any effect.

This may depend on the used Less version. With current master the following structure:

// main.less:
@import "components/q.less";

// components/q.less:
path.nv-line {
  marker-mid: url(#line-marker);
}

results in:
with -ru -> marker-mid: url(components/#line-marker);
w/o -ru -> marker-mid: url(#line-marker);

@lukeapage
Copy link
Member

is components/#line-marker valid? It seems to me that if it refers to the page context rather than the less context then it seems okay to make an exception for url's that are just #.* ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants