@adobe/helix-docx2md 1.0.20 → 1.0.23

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,24 @@
1
+ ## [1.0.23](https://github.com/adobe/helix-docx2md/compare/v1.0.22...v1.0.23) (2022-08-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/helix-mediahandler to v1.0.42 ([#108](https://github.com/adobe/helix-docx2md/issues/108)) ([ae7726c](https://github.com/adobe/helix-docx2md/commit/ae7726ccce4b26802c42b515288930ce2c328218))
7
+
8
+ ## [1.0.22](https://github.com/adobe/helix-docx2md/compare/v1.0.21...v1.0.22) (2022-07-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/helix-markdown-support to v3.1.8 ([0884578](https://github.com/adobe/helix-docx2md/commit/0884578e7fb5e190e4791972fd307242485a55d2))
14
+
15
+ ## [1.0.21](https://github.com/adobe/helix-docx2md/compare/v1.0.20...v1.0.21) (2022-07-26)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * proper handling of nested lists ([#98](https://github.com/adobe/helix-docx2md/issues/98)) ([250eee0](https://github.com/adobe/helix-docx2md/commit/250eee074a31eec756fc2a83da3ed5bb4168fa74)), closes [#97](https://github.com/adobe/helix-docx2md/issues/97)
21
+
1
22
  ## [1.0.20](https://github.com/adobe/helix-docx2md/compare/v1.0.19...v1.0.20) (2022-07-09)
2
23
 
3
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-docx2md",
3
- "version": "1.0.20",
3
+ "version": "1.0.23",
4
4
  "description": "Helix library that converts word documents to markdown",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -13,7 +13,6 @@
13
13
  },
14
14
  "scripts": {
15
15
  "test": "c8 mocha",
16
- "test-ci": "c8 mocha && codecov",
17
16
  "lint": "eslint .",
18
17
  "semantic-release": "semantic-release"
19
18
  },
@@ -34,7 +33,7 @@
34
33
  },
35
34
  "homepage": "https://github.com/adobe/helix-docx2md#readme",
36
35
  "dependencies": {
37
- "@adobe/helix-markdown-support": "3.1.7",
36
+ "@adobe/helix-markdown-support": "3.1.8",
38
37
  "@adobe/helix-shared-process-queue": "1.1.5",
39
38
  "@adobe/mammoth": "1.4.15-bleeding.1",
40
39
  "dirname-filename-esm": "1.1.1",
@@ -45,27 +44,27 @@
45
44
  "remark-stringify": "10.0.2",
46
45
  "unified": "10.1.2",
47
46
  "unist-util-find": "1.0.2",
48
- "unist-util-visit": "4.1.0",
47
+ "unist-util-visit": "4.1.1",
49
48
  "yauzl": "2.10.0"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@adobe/eslint-config-helix": "1.3.2",
53
- "@adobe/helix-mediahandler": "1.0.34",
52
+ "@adobe/helix-mediahandler": "1.0.42",
54
53
  "@semantic-release/changelog": "6.0.1",
55
54
  "@semantic-release/exec": "6.0.3",
56
55
  "@semantic-release/git": "10.0.1",
57
- "c8": "7.11.3",
56
+ "c8": "7.12.0",
58
57
  "dotenv": "16.0.1",
59
- "eslint": "8.19.0",
58
+ "eslint": "8.23.0",
60
59
  "eslint-plugin-header": "3.1.1",
61
60
  "eslint-plugin-import": "2.26.0",
62
61
  "husky": "8.0.1",
63
- "junit-report-builder": "3.0.0",
62
+ "junit-report-builder": "3.0.1",
64
63
  "lint-staged": "13.0.3",
65
64
  "mocha": "10.0.0",
66
65
  "mocha-multi-reporters": "1.5.1",
67
- "semantic-release": "19.0.3",
68
- "unist-util-inspect": "7.0.0"
66
+ "semantic-release": "19.0.5",
67
+ "unist-util-inspect": "7.0.1"
69
68
  },
70
69
  "lint-staged": {
71
70
  "*.js": "eslint"
@@ -87,23 +87,29 @@ export default function paragraph(h, node, parent, siblings) {
87
87
  const { numId = 0, isOrdered = false, level = '0' } = numbering;
88
88
  const lvl = Number.parseInt(level, 10);
89
89
  let result = null;
90
-
90
+ const listProps = {
91
+ ordered: isOrdered,
92
+ spread: false,
93
+ level: lvl,
94
+ };
91
95
  // find correct parent
92
96
  let tail;
93
97
  while (lists.length > 0) {
94
98
  tail = lists.pop();
95
- if (tail.ordered === isOrdered && lists.length <= lvl) {
99
+ if (tail.ordered !== isOrdered && tail.level === lvl) {
100
+ tail = null;
101
+ } else if (lists.length <= lvl) {
96
102
  break;
97
103
  }
98
104
  tail = null;
99
105
  }
100
106
  if (!tail) {
101
- tail = h('list', { ordered: isOrdered, spread: false }, []);
107
+ tail = h('list', listProps, []);
102
108
  result = tail;
103
109
  }
104
110
  lists.push(tail);
105
111
  while (lists.length <= lvl) {
106
- const newList = h('list', { ordered: isOrdered, spread: false }, []);
112
+ const newList = h('list', listProps, []);
107
113
  if (tail.children.length > 0) {
108
114
  // append new list to end of the last list item
109
115
  tail.children[tail.children.length - 1].children.push(newList);