-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
escape-svg fails for unquoted URLs #30835
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
Comments
/CC @twbs/css-review (also please add v4/v5 labels where this applies) |
So, I'm able to reproduce this on both v5 and v4. Please have a look at a dedicated SassMeister. I took @jrdutton examples and added one of our own SVGs. FWIW, this function expects quoted URL since SVG as data URi won't work without quotes (simply remove the one in @jrdutton in fact, if you're using base64 encoded SVGs you don't need to use That being said, using the second suggestion —replacing Two things to consider then:
@mdo @MartijnCuppens any thought? |
Thank you @ffoodd for looking at this. I will take a look at the articles you suggest. |
Opened #31653 to leave a comment in the source code. Don't think we need too much more here for now so we don't risk breaking behaviors for others. |
Closes #30835 by leaving a comment in the source that the escape-svg() function must have quotes around data URIs.
Closes #30835 by leaving a comment in the source that the escape-svg() function must have quotes around data URIs.
Closes twbs#30835 by leaving a comment in the source that the escape-svg() function must have quotes around data URIs.
When using the SCSS version of Bootstrap, I am experiencing problems when providing an unquoted URL for the $breadcrumb-divider variable.
This is because the escape-svg function expects the URL to be quoted. Therefore, it removes the first five url(' and last two characters '). However, in the case of an unquoted URL, this fails. My understanding is the unquoted URLs are valid SCSS for the url function.
File poc.scss.txt shows the escape-svg function and other helper functions taken from the Bootstrap SCSS.
It also includes two other variations, my attempts at fixing the issue.
poc.scss.txt
File poc.css shows the output when compiled.
poc.css.txt
.breadcrumb-item shows the CSS using the existing function. In the case of url(data, the data part is truncated to ata
.breadcrumb-item2 and breadcrumb-item3 show the outputs with the adjusted function.
I am happy to create a pull request if agreed that this is an issue to be fixed.
The text was updated successfully, but these errors were encountered: