subfont 6.4.1 → 6.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ### v6.4.1 (2022-01-10)
1
+ ### v6.4.2 (2022-04-13)
2
+
3
+ - [Handle escape sequences in CSS strings](https://github.com/Munter/subfont/commit/6c0493b3e0a96e2651e4c37cdf4e45fdb090acc4) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
4
+
5
+ ### v6.4.1 (2022-01-11)
2
6
 
3
7
  - [Update font-tracer to ^3.1.0, fixes \#157](https://github.com/Munter/subfont/commit/c98c0d8a2723c2f68b11dadb6c33c34c708355f4) ([Andreas Lind](mailto:andreas.lind@workday.com))
4
8
 
@@ -264,16 +268,13 @@
264
268
  #### Pull requests
265
269
 
266
270
  - [#76](https://github.com/Munter/subfont/pull/76) Fix the prettier setup ([Andreas Lind](mailto:andreas.lind@peakon.com))
271
+ - [#75](https://github.com/Munter/subfont/pull/75) Fix omitFallbacks with Google Web Fonts ([Andreas Lind](mailto:andreas.lind@peakon.com))
267
272
 
268
273
  #### Commits to master
269
274
 
270
275
  - [Switch to the official css-font-parser now that bramstein\/css-font-parser\#7 has been merged and released](https://github.com/Munter/subfont/commit/457c7f0e4cef0a8c1bd8f816c23ace64c9987424) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
271
276
  - [Don't populate source map relations](https://github.com/Munter/subfont/commit/5c07218b6f1dcc6fad88702a3bcb7b33bf9df54e) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
272
277
 
273
- ### v4.1.2 (2020-01-09)
274
-
275
- - [#75](https://github.com/Munter/subfont/pull/75) Fix omitFallbacks with Google Web Fonts ([Andreas Lind](mailto:andreas.lind@peakon.com))
276
-
277
278
  ### v4.1.1 (2020-01-04)
278
279
 
279
280
  - [Add regression test](https://github.com/Munter/subfont/commit/46eddce9c09268dbde459b1f98fe5cec9e4c98f5) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
@@ -304,8 +305,7 @@
304
305
  - [Add vscode debugger launch configuration for the test suite](https://github.com/Munter/subfont/commit/f8f9abc42909c556765555cc49f44eb40a9194db) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
305
306
  - [Guard against an already detached relation when cleaning up](https://github.com/Munter/subfont/commit/6392fc359222772c9033a58a9020e3b35487d019) ([Andreas Lind](mailto:andreaslindpetersen@gmail.com))
306
307
 
307
- ### v4.0.3 (2019-11-02)
308
-
308
+ ### v4.0.3
309
309
  #### Pull requests
310
310
 
311
311
  - [#67](https://github.com/Munter/subfont/pull/67) Only warn about missing fonttools install if we are actually trying t… ([Peter Müller](mailto:munter@fumle.dk))
package/lib/unquote.js CHANGED
@@ -1,3 +1,13 @@
1
+ function unescapeCssString(str) {
2
+ return str.replace(
3
+ /\\([0-9a-f]{1,6})(\s?)/gi,
4
+ ($0, hexChars, followingWhitespace) =>
5
+ `${String.fromCharCode(parseInt(hexChars, 16))}${
6
+ hexChars.length === 6 ? followingWhitespace : ''
7
+ }`
8
+ );
9
+ }
10
+
1
11
  module.exports = function unquote(str) {
2
12
  if (typeof str !== 'string') {
3
13
  return str;
@@ -7,7 +17,7 @@ module.exports = function unquote(str) {
7
17
  /^'([^']*)'$|^"([^"]*)"$/,
8
18
  ($0, singleQuoted, doubleQuoted) =>
9
19
  typeof singleQuoted === 'string'
10
- ? singleQuoted.replace(/\\'/g, "'")
11
- : doubleQuoted.replace(/\\"/g, '"')
20
+ ? unescapeCssString(singleQuoted.replace(/\\'/g, "'"))
21
+ : unescapeCssString(doubleQuoted.replace(/\\"/g, '"'))
12
22
  );
13
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "subfont",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "Speeds up your pages initial paint by automatically subsetting local or Google fonts and loading them optimally",
5
5
  "engines": {
6
6
  "node": ">=10.0.0"