@tryghost/mg-jekyll-export 0.3.18 → 0.3.20

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.
@@ -8,8 +8,9 @@ Receives raw HTML, returns processed HTML
8
8
 
9
9
  export default (rawHtml, options = {}) => {
10
10
  const $html = $.load(rawHtml, {
11
- decodeEntities: false
12
- });
11
+ decodeEntities: false,
12
+ scriptingEnabled: false
13
+ }, false); // This `false` is `isDocument`. If `true`, <html>, <head>, and <body> elements are introduced
13
14
 
14
15
  // Convert relative links and image paths to absolute
15
16
  if (options.url) {
@@ -49,7 +50,14 @@ export default (rawHtml, options = {}) => {
49
50
  }
50
51
  });
51
52
 
52
- let html = $html.html().trim();
53
+ // convert HTML back to a string
54
+ let html = $html.html();
55
+
56
+ // Remove empty attributes
57
+ html = html.replace(/=""/g, '');
58
+
59
+ // Trim whitespace
60
+ html = html.trim();
53
61
 
54
62
  return html;
55
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/mg-jekyll-export",
3
- "version": "0.3.18",
3
+ "version": "0.3.20",
4
4
  "description": "tbc",
5
5
  "repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-jekyll-export",
6
6
  "author": "Ghost Foundation",
@@ -21,17 +21,17 @@
21
21
  "access": "public"
22
22
  },
23
23
  "devDependencies": {
24
- "eslint": "8.51.0",
24
+ "eslint": "8.54.0",
25
25
  "jest": "29.7.0",
26
26
  "jest-extended": "4.0.2"
27
27
  },
28
28
  "dependencies": {
29
29
  "@tryghost/errors": "1.2.26",
30
- "@tryghost/mg-fs-utils": "^0.12.18",
31
- "@tryghost/string": "0.2.8",
32
- "cheerio": "0.22.0",
30
+ "@tryghost/mg-fs-utils": "^0.12.20",
31
+ "@tryghost/string": "0.2.10",
32
+ "cheerio": "1.0.0-rc.12",
33
33
  "front-matter": "4.0.2",
34
34
  "markdown-it": "13.0.2"
35
35
  },
36
- "gitHead": "c865538e1d67fac4fc6f5b53fae5127d164365c8"
36
+ "gitHead": "87eac9f1a90b9e8935ce70d9459db6f8ffec6133"
37
37
  }