@tryghost/mg-html-lexical 0.8.0 → 0.10.0
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
2
|
import errors from '@tryghost/errors';
|
|
3
3
|
import { convertToHTMLCard } from './convert-to-html-card.js';
|
|
4
4
|
// Ghost requires at least one child in the root. This empty paragraph is used
|
|
@@ -11,6 +11,8 @@ const emptyParagraph = {
|
|
|
11
11
|
type: 'paragraph',
|
|
12
12
|
version: 1
|
|
13
13
|
};
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const { htmlToLexical } = require('@tryghost/kg-html-to-lexical');
|
|
14
16
|
const convertPost = (post, htmlCard = false) => {
|
|
15
17
|
if (typeof post.html === 'undefined' || post.html === 'undefined') {
|
|
16
18
|
throw new errors.InternalServerError({ message: 'Post has no html field to convert' });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-post.js","sourceRoot":"","sources":["../../src/lib/convert-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"convert-post.js","sourceRoot":"","sources":["../../src/lib/convert-post.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAS5D,8EAA8E;AAC9E,kFAAkF;AAClF,MAAM,cAAc,GAAG;IACnB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC;CACb,CAAC;AAEF,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-html-lexical",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/TryGhost/migrate.git",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "24.
|
|
28
|
-
"@typescript-eslint/parser": "8.
|
|
27
|
+
"@types/node": "24.13.2",
|
|
28
|
+
"@typescript-eslint/parser": "8.61.0",
|
|
29
29
|
"c8": "11.0.0",
|
|
30
30
|
"eslint": "8.57.1",
|
|
31
31
|
"typescript": "6.0.3",
|
|
32
|
-
"@tryghost/listr-smart-renderer": "0.
|
|
32
|
+
"@tryghost/listr-smart-renderer": "0.15.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@tryghost/errors": "3.
|
|
36
|
-
"@tryghost/kg-html-to-lexical": "1.2
|
|
35
|
+
"@tryghost/errors": "3.2.4",
|
|
36
|
+
"@tryghost/kg-html-to-lexical": "1.3.2"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"dev": "echo \"Implement me!\"",
|