We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b3e508f + 2a7f1e9 commit 893b11eCopy full SHA for 893b11e
1 file changed
parse-css.js
@@ -47,7 +47,7 @@ function preprocess(str) {
47
// Decode a surrogate pair into an astral codepoint.
48
var lead = code - 0xd800;
49
var trail = str.charCodeAt(i+1) - 0xdc00;
50
- code = Math.pow(2, 20) + lead * Math.pow(2, 10) + trail;
+ code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
51
i++;
52
}
53
codepoints.push(code);
@@ -58,7 +58,7 @@ function preprocess(str) {
58
function stringFromCode(code) {
59
if(code <= 0xffff) return String.fromCharCode(code);
60
// Otherwise, encode astral char as surrogate pair.
61
- code -= Math.pow(2, 20);
+ code -= Math.pow(2, 16);
62
var lead = Math.floor(code/Math.pow(2, 10)) + 0xd800;
63
var trail = code % Math.pow(2, 10) + 0xdc00;
64
return String.fromCharCode(lead) + String.fromCharCode(trail);
0 commit comments