single-file-core 1.5.52 → 1.5.53

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.
@@ -65,6 +65,7 @@ const BLOCK_CLOSE = "}";
65
65
  const EMPTY_STRING = "";
66
66
  const CSS_IMPORTANCE_NOT_IMPORTANT = 0;
67
67
  const CSS_IMPORTANCE_IMPORTANT = 1;
68
+ const INVALID_CSS_ESCAPE_TEST = /\\(?![0-9a-fA-F]{1,6}\s|[^0-9a-zA-Z])/;
68
69
 
69
70
  export {
70
71
  process
@@ -423,8 +424,9 @@ function collectDeclarationItemsForElement(element, docContext) {
423
424
  const { type, value } = declaration.data;
424
425
  if (type === DECLARATION_TYPE && value) {
425
426
  const isRawValue = value.type === RAW_TYPE;
426
- const isVendorValue = value.type === VALUE_TYPE && value.children.head && value.children.head.data.name && value.children.head.data.name.startsWith(VENDOR_PREFIX);
427
- if (!isRawValue && !isVendorValue) {
427
+ const isVendorValue = value.type === VALUE_TYPE && hasChildNodes(value) && value.children.head.data.name && value.children.head.data.name.startsWith(VENDOR_PREFIX);
428
+ const isInvalidValue = value.type === VALUE_TYPE && hasChildNodes(value) && value.children.head.data.name && INVALID_CSS_ESCAPE_TEST.test(value.children.head.data.name);
429
+ if (!isRawValue && !isVendorValue && !isInvalidValue) {
428
430
  allDeclarations.push({
429
431
  declaration,
430
432
  selector,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "single-file-core",
3
- "version": "1.5.52",
3
+ "version": "1.5.53",
4
4
  "description": "SingleFile Core",
5
5
  "author": "Gildas Lormeau",
6
6
  "license": "AGPL-3.0-or-later",