html-to-gutenberg 4.2.2 → 4.2.4

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.
Files changed (2) hide show
  1. package/index.js +4 -2
  2. package/package.json +7 -3
package/index.js CHANGED
@@ -1523,7 +1523,7 @@ const block = async (
1523
1523
  css += styles.map((style) => {
1524
1524
  return `${style.content}`;
1525
1525
  }).join('\n');
1526
-
1526
+
1527
1527
 
1528
1528
  const scriptRegex = /<script[^>]*>([\s\S]*?)<\/script>/gi;
1529
1529
  const scriptSrcRegex =
@@ -1537,7 +1537,9 @@ const block = async (
1537
1537
  }
1538
1538
  return '';
1539
1539
  });
1540
-
1540
+ const $ = cheerio.load(htmlContent, { xmlMode: true, decodeEntities: false });
1541
+ $('head').remove();
1542
+ htmlContent = $.html({ xml: false, decodeEntities: false });
1541
1543
  const fetchJsPromises = [];
1542
1544
 
1543
1545
  while ((jsMatch = scriptSrcRegex.exec(htmlContent)) !== null) {
package/package.json CHANGED
@@ -14,20 +14,24 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/babel__core": "^7.20.5",
17
+ "@types/beautify": "^0.0.3",
17
18
  "@types/cheerio": "^1.0.0",
18
- "@types/image-to-base64": "^2.1.2"
19
+ "@types/image-to-base64": "^2.1.2",
20
+ "@types/prettier": "^3.0.0",
21
+ "@types/svgo": "^3.0.0"
19
22
  },
20
23
  "type": "module",
21
24
  "types": "index.ts",
22
25
  "name": "html-to-gutenberg",
23
- "version": "4.2.2",
26
+ "version": "4.2.4",
24
27
  "description": "Transform any valid HTML string into fully editable WP Gutenberg blocks in seconds rather than hours.",
25
28
  "main": "index.js",
26
29
  "directories": {
27
30
  "test": "test"
28
31
  },
29
32
  "scripts": {
30
- "test": "jest"
33
+ "test": "jest",
34
+ "build": "tsc"
31
35
  },
32
36
  "repository": {
33
37
  "type": "git",