@tryghost/mg-jekyll-export 0.3.19 → 0.3.21
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/lib/process-html.js +11 -3
- package/package.json +8 -8
package/lib/process-html.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
3
|
+
"version": "0.3.21",
|
|
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.
|
|
24
|
+
"eslint": "8.55.0",
|
|
25
25
|
"jest": "29.7.0",
|
|
26
26
|
"jest-extended": "4.0.2"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tryghost/errors": "1.
|
|
30
|
-
"@tryghost/mg-fs-utils": "^0.12.
|
|
31
|
-
"@tryghost/string": "0.2.
|
|
32
|
-
"cheerio": "0.
|
|
29
|
+
"@tryghost/errors": "1.3.0",
|
|
30
|
+
"@tryghost/mg-fs-utils": "^0.12.21",
|
|
31
|
+
"@tryghost/string": "0.2.11",
|
|
32
|
+
"cheerio": "1.0.0-rc.12",
|
|
33
33
|
"front-matter": "4.0.2",
|
|
34
|
-
"markdown-it": "
|
|
34
|
+
"markdown-it": "14.0.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "e91603ed4e431bba60521d63a070e397d2ccee2f"
|
|
37
37
|
}
|