@tryghost/mg-medium-export 0.15.1 → 0.15.3
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/LICENSE +1 -1
- package/README.md +1 -1
- package/lib/process-content.js +28 -0
- package/lib/process-post.js +2 -2
- package/package.json +9 -9
package/LICENSE
CHANGED
package/README.md
CHANGED
package/lib/process-content.js
CHANGED
|
@@ -37,5 +37,33 @@ export default ({content, post}) => {
|
|
|
37
37
|
$(bq).html(`<p>${$(bq).html()}</p>`);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
+
$content.find('pre.graf--pre').each((i, pre) => {
|
|
41
|
+
$(pre).removeAttr('name');
|
|
42
|
+
$(pre).removeAttr('id');
|
|
43
|
+
$(pre).removeAttr('class');
|
|
44
|
+
$(pre).removeAttr('data-code-block-mode');
|
|
45
|
+
$(pre).removeAttr('spellcheck');
|
|
46
|
+
$(pre).html($(pre).html().trim());
|
|
47
|
+
|
|
48
|
+
const lang = $(pre).attr('data-code-block-lang');
|
|
49
|
+
$(pre).removeAttr('data-code-block-lang');
|
|
50
|
+
|
|
51
|
+
$(pre).find('span.pre--content').each((ii, span) => {
|
|
52
|
+
span.name = 'code';
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
$(pre).find('code').each((iii, code) => {
|
|
56
|
+
$(code).removeAttr('name');
|
|
57
|
+
$(code).removeAttr('id');
|
|
58
|
+
$(code).removeAttr('class');
|
|
59
|
+
|
|
60
|
+
if (lang && lang.length > 0) {
|
|
61
|
+
$(code).addClass(`language-${lang}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$(code).html($(code).html().replace(/<br>/g, ' \n').trim());
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
40
68
|
return $content.html().trim();
|
|
41
69
|
};
|
package/lib/process-post.js
CHANGED
|
@@ -86,7 +86,7 @@ const processTags = ({$tags}) => {
|
|
|
86
86
|
const processFeatureImage = ({html, post}) => {
|
|
87
87
|
const $html = $.load(html, {
|
|
88
88
|
decodeEntities: false
|
|
89
|
-
});
|
|
89
|
+
}, false);
|
|
90
90
|
|
|
91
91
|
// Look for data-is-featured
|
|
92
92
|
let featured = $html('[data-is-featured]')[0];
|
|
@@ -131,7 +131,7 @@ const processFeatureImage = ({html, post}) => {
|
|
|
131
131
|
export default ({name, html, globalUser, options}) => {
|
|
132
132
|
const $post = $.load(html, {
|
|
133
133
|
decodeEntities: false
|
|
134
|
-
});
|
|
134
|
+
}, false);
|
|
135
135
|
|
|
136
136
|
const post = processMeta({name, $post, options});
|
|
137
137
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-medium-export",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
4
4
|
"description": "tbc",
|
|
5
5
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-medium-export",
|
|
6
6
|
"author": "Ghost Foundation",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "echo \"Implement me!\"",
|
|
12
|
-
"test": "
|
|
12
|
+
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
13
13
|
"lint": "eslint . --ext .js --cache",
|
|
14
14
|
"posttest": "yarn lint"
|
|
15
15
|
},
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"eslint": "8.
|
|
25
|
-
"jest": "29.
|
|
24
|
+
"eslint": "8.47.0",
|
|
25
|
+
"jest": "29.6.2",
|
|
26
26
|
"jest-extended": "3.2.4"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tryghost/debug": "0.1.
|
|
30
|
-
"@tryghost/mg-fs-utils": "^0.12.
|
|
31
|
-
"@tryghost/string": "0.2.
|
|
32
|
-
"cheerio": "0.
|
|
29
|
+
"@tryghost/debug": "0.1.26",
|
|
30
|
+
"@tryghost/mg-fs-utils": "^0.12.15",
|
|
31
|
+
"@tryghost/string": "0.2.8",
|
|
32
|
+
"cheerio": "1.0.0-rc.12",
|
|
33
33
|
"date-fns": "2.30.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "0df990176ed00c9076d1bec7ddafa2a6b2ddd967"
|
|
36
36
|
}
|