libsass icon indicating copy to clipboard operation
libsass copied to clipboard

SourceMap result is wrong when using asian characters

Open constantin-v opened this issue 6 years ago • 4 comments

input.scss

body {
  font-family: 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', '蘋方-繁', 'PingFang HK','蘋方-港', 'Apple LiGothic Medium', '蘋果儷中黑', sans-serif;
}

.someCss {
    align-items: center;
	height:200px;
    background-size: cover;
    display: flex;
}

.myDivStyle {
    align-items: center;
    background-color:red;
	height:200px;
    background-size: cover;
    display: flex;
}

Actual results

I was not able to use http://libsass.ocbnet.ch/srcmap/ because of the non Latin1 characters. When I try to bookmark I got this error : Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range. I linked the result of the node-sass compilation that I uploaded on github

libsass 3.5.4

body{font-family:'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', '蘋方-繁', 'PingFang HK','蘋方-港', 'Apple LiGothic Medium', '蘋果儷中黑', sans-serif}.someCss{align-items:center;height:200px;background-size:cover;display:flex}.myDivStyle{align-items:center;background-color:red;height:200px;background-size:cover;display:flex}

/*# sourceMappingURL=test.css.map */

As you can see on screenshot, the sourcemap is broken as it give me the wrong line when I'm using the sourcemap with Chrome dev tools

Sass1 Sass2

Expected result

Using asian characters shouldn't break SourceMap.

As an example, replacing asian chars by latin is working fine. See:

Sass Sass

version info:

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

For more files / screenshots please see this repo.

Thanks

constantin-v avatar Jun 16 '20 21:06 constantin-v

Thanks for your report! Pretty sure this is already fixed on master via https://github.com/sass/libsass/commit/df8ff3a2779637b51598b2881aa06c6e9b2f6587. Please note that this fix is not released in any version yet.

mgreter avatar Jun 17 '20 18:06 mgreter

Thanks @mgreter ! Do you know what is the release cycle / when is the next release ? Thanks

constantin-v avatar Jun 17 '20 18:06 constantin-v

Sorry, this hasn't aged well. Probably soon ;)

mgreter avatar Mar 04 '21 05:03 mgreter

Closing as already fixed, only missing a new release

mgreter avatar May 20 '21 23:05 mgreter