@adobe/helix-importer 2.8.13 → 2.9.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [2.9.0](https://github.com/adobe/helix-importer/compare/v2.8.13...v2.9.0) (2023-04-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* implement superscript and subscript support ([#137](https://github.com/adobe/helix-importer/issues/137)) ([1f0d97f](https://github.com/adobe/helix-importer/commit/1f0d97fd844d7f8d2145970b97348211efd026e2))
|
|
7
|
+
|
|
1
8
|
## [2.8.13](https://github.com/adobe/helix-importer/compare/v2.8.12...v2.8.13) (2023-04-16)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -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
|
});
|