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

str-slice removes quotes #2863

Closed
PhilippSoehnlein opened this issue Apr 11, 2019 · 0 comments · Fixed by #2864
Closed

str-slice removes quotes #2863

PhilippSoehnlein opened this issue Apr 11, 2019 · 0 comments · Fixed by #2864

Comments

@PhilippSoehnlein
Copy link

input.scss

$foo: "'abcd'"; // '"abcd"' also doesn't work

@error str-slice( $foo, 1, 2 ); // not real code, @error is just used to get raw value of $foo

Actual results

libsass 3.5.4

ab on line 3 at column 1

Expected result

'a on line 3 at column 1

ruby sass 3.5.6

'a on line 3 at column 1

version info:

$ node-sass --version
node-sass	4.10.0	(Wrapper)	[JavaScript]
libsass  	3.5.4	(Sass Compiler)	[C/C++]

Further context

We have a string-utility function in our code base, which slices bigger strings in smaller pieces using str-slice. It works fine, except when the piece that should be sliced out of a bigger string coincidentally starts with quotes and ends with the same quotes, then str-slice returns the sliced string without the quotes, which makes our function return incorrect stuff.

mgreter added a commit to mgreter/libsass that referenced this issue Apr 11, 2019
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 11, 2019
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 11, 2019
mgreter added a commit to mgreter/libsass that referenced this issue Apr 12, 2019
mgreter added a commit to mgreter/libsass that referenced this issue Apr 12, 2019
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 12, 2019
mgreter added a commit to mgreter/sass-spec that referenced this issue Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants