Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

variable interpolation causes additional string escaping #869

Closed
kbullaugheyga opened this issue Apr 17, 2015 · 3 comments
Closed

variable interpolation causes additional string escaping #869

kbullaugheyga opened this issue Apr 17, 2015 · 3 comments

Comments

@kbullaugheyga
Copy link

I encountered a problem with node-sass 3.0.0-beta.5 whereby slashes that appear in a string get escaped if that string also has some interpolated variables. This doesn't exist with the older version I was using (2.1.1).

Here's an example:

echo '$x: "y"; li:before { content: "#{$x}\00a0"; }' | node-sass-3

Produces the output:

li:before {
  content: "y\\00a0"; }

I would have expected the output not to have two slashes, as was the case with node-sass 2.1.1, as illustrated below:

echo '$x: "y"; li:before { content: "#{$x}\00a0"; }' | node-sass-2

Produces the output:

li:before {
  content: "y\00a0"; }

Importantly, it doesn't have a problem if there's no variable interpolation:

echo 'li:before { content: "y\00a0"; }' | node-sass-3

Produces:

li:before {
  content: "y\00a0"; }

This problem cropped up when I was compiling bootstrap-sass, which has the following line in the _breadcrumbs.scss file:

content: "#{$breadcrumb-separator}\00a0";

I think this problem means that node-sass 3.0.0-beta.5 will break bootstrap-sass for everyone.

@saper
Copy link
Member

saper commented Apr 17, 2015

Can you try just plain sassc ? Looks like a libsass issue to me...

@kbullaughey
Copy link

Yes, I can reproduce it with sassc.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 19, 2015

Tracking this upstream in sass/libsass#1115

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

No branches or pull requests

4 participants