@adobe/helix-importer 2.8.13 → 2.9.1
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.9.1](https://github.com/adobe/helix-importer/compare/v2.9.0...v2.9.1) (2023-04-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update adobe fixes ([#139](https://github.com/adobe/helix-importer/issues/139)) ([7cf1d8c](https://github.com/adobe/helix-importer/commit/7cf1d8cfc72f854b1c1268a4360592ae783ada1e))
|
|
7
|
+
|
|
8
|
+
# [2.9.0](https://github.com/adobe/helix-importer/compare/v2.8.13...v2.9.0) (2023-04-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* implement superscript and subscript support ([#137](https://github.com/adobe/helix-importer/issues/137)) ([1f0d97f](https://github.com/adobe/helix-importer/commit/1f0d97fd844d7f8d2145970b97348211efd026e2))
|
|
14
|
+
|
|
1
15
|
## [2.8.13](https://github.com/adobe/helix-importer/compare/v2.8.12...v2.8.13) (2023-04-16)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-importer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "Helix Importer tool: create md / docx from html",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@adobe/eslint-config-helix": "2.0.2",
|
|
29
29
|
"@adobe/helix-docx2md": "1.4.1",
|
|
30
|
-
"@adobe/helix-mediahandler": "2.1.
|
|
30
|
+
"@adobe/helix-mediahandler": "2.1.6",
|
|
31
31
|
"@semantic-release/changelog": "6.0.3",
|
|
32
32
|
"@semantic-release/exec": "6.0.3",
|
|
33
33
|
"@semantic-release/git": "10.0.1",
|
|
34
34
|
"c8": "7.13.0",
|
|
35
35
|
"dirname-filename-esm": "1.1.1",
|
|
36
|
-
"eslint": "8.
|
|
36
|
+
"eslint": "8.39.0",
|
|
37
37
|
"husky": "8.0.3",
|
|
38
38
|
"lint-staged": "13.2.1",
|
|
39
39
|
"mocha": "10.2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"license": "Apache-2.0",
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@adobe/helix-markdown-support": "6.1.1",
|
|
47
|
-
"@adobe/helix-md2docx": "2.0.
|
|
47
|
+
"@adobe/helix-md2docx": "2.0.51",
|
|
48
48
|
"@adobe/mdast-util-gridtables": "1.0.6",
|
|
49
49
|
"@adobe/remark-gridtables": "1.0.2",
|
|
50
50
|
"form-data": "4.0.0",
|
|
@@ -33,6 +33,21 @@ function remarkImageReferences() {
|
|
|
33
33
|
return imageReferences;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
function htmlElementNode(element, state, node) {
|
|
37
|
+
if (node.children && node.children.length > 0) {
|
|
38
|
+
return [{
|
|
39
|
+
type: 'html',
|
|
40
|
+
value: `<${element}>`,
|
|
41
|
+
},
|
|
42
|
+
...state.all(node),
|
|
43
|
+
{
|
|
44
|
+
type: 'html',
|
|
45
|
+
value: `</${element}>`,
|
|
46
|
+
}];
|
|
47
|
+
}
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
|
|
36
51
|
export default class PageImporter {
|
|
37
52
|
params;
|
|
38
53
|
|
|
@@ -65,20 +80,9 @@ export default class PageImporter {
|
|
|
65
80
|
.use(parse, { emitParseErrors: true })
|
|
66
81
|
.use(rehype2remark, {
|
|
67
82
|
handlers: {
|
|
68
|
-
u: (state, node) =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
type: 'html',
|
|
72
|
-
value: '<u>',
|
|
73
|
-
},
|
|
74
|
-
...state.all(node),
|
|
75
|
-
{
|
|
76
|
-
type: 'html',
|
|
77
|
-
value: '</u>',
|
|
78
|
-
}];
|
|
79
|
-
}
|
|
80
|
-
return '';
|
|
81
|
-
},
|
|
83
|
+
u: (state, node) => htmlElementNode('u', state, node),
|
|
84
|
+
sub: (state, node) => htmlElementNode('sub', state, node),
|
|
85
|
+
sup: (state, node) => htmlElementNode('sup', state, node),
|
|
82
86
|
...gridtableHandlers,
|
|
83
87
|
},
|
|
84
88
|
})
|
|
@@ -178,7 +178,7 @@ describe('PageImporter tests - fixtures', () => {
|
|
|
178
178
|
await featureTest('space');
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
it('import -
|
|
182
|
-
await featureTest('
|
|
181
|
+
it('import - sub and sup', async () => {
|
|
182
|
+
await featureTest('subsup');
|
|
183
183
|
});
|
|
184
184
|
});
|