@adobe/helix-importer 2.5.13 → 2.5.15
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 +14 -0
- package/package.json +5 -8
- package/src/importer/HTML2x.js +1 -1
- package/test/importers/HTML2x.spec.js +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.5.15](https://github.com/adobe/helix-importer/compare/v2.5.14...v2.5.15) (2023-01-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update adobe fixes ([#84](https://github.com/adobe/helix-importer/issues/84)) ([5671076](https://github.com/adobe/helix-importer/commit/5671076fb67ba6d48512b0094e3080ee73ec92a4))
|
|
7
|
+
|
|
8
|
+
## [2.5.14](https://github.com/adobe/helix-importer/compare/v2.5.13...v2.5.14) (2023-01-24)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* warn should warn, no error ([459bd15](https://github.com/adobe/helix-importer/commit/459bd153e09e1b2479d5029666af89f6a85ec4ad))
|
|
14
|
+
|
|
1
15
|
## [2.5.13](https://github.com/adobe/helix-importer/compare/v2.5.12...v2.5.13) (2023-01-23)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-importer",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.15",
|
|
4
4
|
"description": "Helix Importer tool: create md / docx from html",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -25,18 +25,15 @@
|
|
|
25
25
|
"*.js": "eslint"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@adobe/eslint-config-helix": "
|
|
29
|
-
"@adobe/helix-docx2md": "1.3.
|
|
30
|
-
"@adobe/helix-mediahandler": "2.0.
|
|
28
|
+
"@adobe/eslint-config-helix": "2.0.1",
|
|
29
|
+
"@adobe/helix-docx2md": "1.3.11",
|
|
30
|
+
"@adobe/helix-mediahandler": "2.0.3",
|
|
31
31
|
"@semantic-release/changelog": "6.0.2",
|
|
32
32
|
"@semantic-release/exec": "6.0.3",
|
|
33
33
|
"@semantic-release/git": "10.0.1",
|
|
34
34
|
"c8": "7.12.0",
|
|
35
35
|
"dirname-filename-esm": "1.1.1",
|
|
36
36
|
"eslint": "8.32.0",
|
|
37
|
-
"eslint-import-resolver-exports": "1.0.0-beta.4",
|
|
38
|
-
"eslint-plugin-header": "3.1.1",
|
|
39
|
-
"eslint-plugin-import": "2.27.5",
|
|
40
37
|
"husky": "8.0.3",
|
|
41
38
|
"lint-staged": "13.1.0",
|
|
42
39
|
"mocha": "10.2.0",
|
|
@@ -47,7 +44,7 @@
|
|
|
47
44
|
"license": "Apache-2.0",
|
|
48
45
|
"dependencies": {
|
|
49
46
|
"@adobe/helix-markdown-support": "6.1.0",
|
|
50
|
-
"@adobe/helix-md2docx": "2.0.
|
|
47
|
+
"@adobe/helix-md2docx": "2.0.34",
|
|
51
48
|
"@adobe/mdast-util-gridtables": "1.0.5",
|
|
52
49
|
"@adobe/remark-gridtables": "1.0.1",
|
|
53
50
|
"form-data": "4.0.0",
|
package/src/importer/HTML2x.js
CHANGED
|
@@ -316,6 +316,22 @@ describe('html2md tests', () => {
|
|
|
316
316
|
strictEqual(out.html.trim(), '<body><img src="./image.jpg"></body>');
|
|
317
317
|
strictEqual(out.md.trim(), '![][image0]\n\n[image0]: ./image.jpg');
|
|
318
318
|
});
|
|
319
|
+
|
|
320
|
+
it('html2md removes original hrs but keeps md section breaks', async () => {
|
|
321
|
+
// hr from the source document are removed because they are meaningless
|
|
322
|
+
// (understand: they do not match the markdown section break concept)
|
|
323
|
+
// but hr added by the transformation are kept because they represent the sections breaks
|
|
324
|
+
const out = await html2md('https://www.sample.com/hr.html', '<html><body><p>text 1</p><hr><p>text 2</p><hr><p>text 3</p><p>text 4</p></body></html>', {
|
|
325
|
+
transformDOM: ({ document }) => {
|
|
326
|
+
const p = document.querySelector('p:last-of-type');
|
|
327
|
+
const hr = document.createElement('hr');
|
|
328
|
+
p.after(hr);
|
|
329
|
+
return document.body;
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
strictEqual(out.html.trim(), '<body><p>text 1</p><p>text 2</p><p>text 3</p><p>text 4</p><hr></body>');
|
|
333
|
+
strictEqual(out.md.trim(), 'text 1\n\ntext 2\n\ntext 3\n\ntext 4\n\n---');
|
|
334
|
+
});
|
|
319
335
|
});
|
|
320
336
|
|
|
321
337
|
describe('html2docx tests', () => {
|