@tryghost/mg-medium-export 0.15.2 → 0.15.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2013-2022 Ghost Foundation
3
+ Copyright (c) 2013-2023 Ghost Foundation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -99,4 +99,4 @@ yarn dev medium --pathToZip /path/to/my-export.zip
99
99
 
100
100
  # Copyright & License
101
101
 
102
- Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).
102
+ Copyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE).
@@ -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
  };
@@ -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.2",
3
+ "version": "0.15.4",
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": "node --experimental-vm-modules $(yarn bin jest)",
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.44.0",
25
- "jest": "29.5.0",
26
- "jest-extended": "3.2.4"
24
+ "eslint": "8.48.0",
25
+ "jest": "29.6.4",
26
+ "jest-extended": "4.0.1"
27
27
  },
28
28
  "dependencies": {
29
- "@tryghost/debug": "0.1.25",
30
- "@tryghost/mg-fs-utils": "^0.12.14",
31
- "@tryghost/string": "0.2.7",
32
- "cheerio": "0.22.0",
29
+ "@tryghost/debug": "0.1.26",
30
+ "@tryghost/mg-fs-utils": "^0.12.16",
31
+ "@tryghost/string": "0.2.8",
32
+ "cheerio": "1.0.0-rc.12",
33
33
  "date-fns": "2.30.0"
34
34
  },
35
- "gitHead": "858b985d1e54eaf41b3a53dbccdc074b57246f9c"
35
+ "gitHead": "05dbefe144850acde9a05b7e25fc84dbf766be88"
36
36
  }