@adobe/helix-docx2md 1.3.14 → 1.4.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
+ # [1.4.0](https://github.com/adobe/helix-docx2md/compare/v1.3.14...v1.4.0) (2023-02-16)
2
+
3
+
4
+ ### Features
5
+
6
+ * detect _top bookmark ([#197](https://github.com/adobe/helix-docx2md/issues/197)) ([029df1e](https://github.com/adobe/helix-docx2md/commit/029df1eafe74f918ca39b1a06fe6cc119e742a32))
7
+
1
8
  ## [1.3.14](https://github.com/adobe/helix-docx2md/compare/v1.3.13...v1.3.14) (2023-02-01)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-docx2md",
3
- "version": "1.3.14",
3
+ "version": "1.4.0",
4
4
  "description": "Helix library that converts word documents to markdown",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -52,19 +52,19 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@adobe/eslint-config-helix": "2.0.1",
55
- "@adobe/helix-mediahandler": "2.0.5",
55
+ "@adobe/helix-mediahandler": "2.0.9",
56
56
  "@semantic-release/changelog": "6.0.2",
57
57
  "@semantic-release/exec": "6.0.3",
58
58
  "@semantic-release/git": "10.0.1",
59
59
  "c8": "7.12.0",
60
60
  "dotenv": "16.0.3",
61
- "eslint": "8.32.0",
61
+ "eslint": "8.34.0",
62
62
  "husky": "8.0.3",
63
63
  "junit-report-builder": "3.0.1",
64
- "lint-staged": "13.1.0",
64
+ "lint-staged": "13.1.1",
65
65
  "mocha": "10.2.0",
66
66
  "mocha-multi-reporters": "1.5.1",
67
- "semantic-release": "19.0.5",
67
+ "semantic-release": "20.1.0",
68
68
  "unist-util-inspect": "7.0.2"
69
69
  },
70
70
  "lint-staged": {
@@ -104,11 +104,13 @@ export default async function dast2mdast(tree, opts = {}) {
104
104
  const slugger = new IDSlugger();
105
105
  for (const bm of bookmarks) {
106
106
  if (!bm.target) {
107
- // eslint-disable-next-line no-continue
108
- continue;
109
- }
110
- // if heading, create an ID from its text
111
- if (bm.target.type === 'heading') {
107
+ if (bm.name !== '_top') {
108
+ // eslint-disable-next-line no-continue
109
+ continue;
110
+ }
111
+ bm.id = '';
112
+ } else if (bm.target.type === 'heading') {
113
+ // if heading, create an ID from its text
112
114
  const text = toString(bm.target).trim();
113
115
  bm.id = slugger.slug(text || 'heading');
114
116
  bm.target.id = bm.id;