@adobe/helix-docx2md 1.0.4 → 1.0.8

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,31 @@
1
+ ## [1.0.8](https://github.com/adobe/helix-docx2md/compare/v1.0.7...v1.0.8) (2022-02-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @adobe/helix-shared-process-queue to v1.1.2 ([#22](https://github.com/adobe/helix-docx2md/issues/22)) ([995066f](https://github.com/adobe/helix-docx2md/commit/995066f3216be72cf9d42c67c41cd62ab3071b6b))
7
+
8
+ ## [1.0.7](https://github.com/adobe/helix-docx2md/compare/v1.0.6...v1.0.7) (2022-02-03)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/helix-shared-process-queue to v1.1.1 ([cbbfbf1](https://github.com/adobe/helix-docx2md/commit/cbbfbf187fc41b4b5a7b8ce4c698f5fd3610662f))
14
+
15
+ ## [1.0.6](https://github.com/adobe/helix-docx2md/compare/v1.0.5...v1.0.6) (2022-01-24)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **deps:** update dependency @adobe/helix-markdown-support to v3.1.2 ([#13](https://github.com/adobe/helix-docx2md/issues/13)) ([2ea396f](https://github.com/adobe/helix-docx2md/commit/2ea396f2d4b05608b2e9bbb7debe86da6fb949ca))
21
+
22
+ ## [1.0.5](https://github.com/adobe/helix-docx2md/compare/v1.0.4...v1.0.5) (2022-01-17)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * remove leftover code ([#8](https://github.com/adobe/helix-docx2md/issues/8)) ([9f294f6](https://github.com/adobe/helix-docx2md/commit/9f294f6293cd970504467b557ea50249a7b65490))
28
+
1
29
  ## [1.0.4](https://github.com/adobe/helix-docx2md/compare/v1.0.3...v1.0.4) (2022-01-17)
2
30
 
3
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-docx2md",
3
- "version": "1.0.4",
3
+ "version": "1.0.8",
4
4
  "description": "Helix library that converts word documents to markdown",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -34,14 +34,12 @@
34
34
  },
35
35
  "homepage": "https://github.com/adobe/helix-docx2md#readme",
36
36
  "dependencies": {
37
- "@adobe/helix-markdown-support": "3.1.1",
38
- "@adobe/helix-shared-process-queue": "1.1.0",
37
+ "@adobe/helix-markdown-support": "3.1.2",
38
+ "@adobe/helix-shared-process-queue": "1.1.2",
39
39
  "@adobe/mammoth": "1.4.15-bleeding.1",
40
40
  "dirname-filename-esm": "1.1.1",
41
- "image-size": "1.0.1",
42
- "mdast-util-to-markdown": "1.2.6",
41
+ "mdast-util-to-markdown": "1.3.0",
43
42
  "mdast-util-to-string": "3.1.0",
44
- "mime": "3.0.0",
45
43
  "remark-gfm": "3.0.1",
46
44
  "remark-parse": "10.0.1",
47
45
  "remark-stringify": "10.0.2",
@@ -52,22 +50,22 @@
52
50
  },
53
51
  "devDependencies": {
54
52
  "@adobe/eslint-config-helix": "1.3.2",
55
- "@adobe/helix-mediahandler": "1.0.1",
53
+ "@adobe/helix-mediahandler": "1.0.5",
56
54
  "@semantic-release/changelog": "6.0.1",
57
55
  "@semantic-release/exec": "6.0.3",
58
56
  "@semantic-release/git": "10.0.1",
59
57
  "c8": "7.11.0",
60
58
  "codecov": "3.8.3",
61
- "dotenv": "11.0.0",
62
- "eslint": "8.6.0",
59
+ "dotenv": "16.0.0",
60
+ "eslint": "8.8.0",
63
61
  "eslint-plugin-header": "3.1.1",
64
62
  "eslint-plugin-import": "2.25.4",
65
63
  "husky": "7.0.4",
66
64
  "junit-report-builder": "3.0.0",
67
- "lint-staged": "12.1.7",
68
- "mocha": "9.1.4",
65
+ "lint-staged": "12.3.3",
66
+ "mocha": "9.2.0",
69
67
  "mocha-multi-reporters": "1.5.1",
70
- "semantic-release": "18.0.1",
68
+ "semantic-release": "19.0.2",
71
69
  "unist-util-inspect": "7.0.0"
72
70
  },
73
71
  "lint-staged": {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2020 Adobe. All rights reserved.
2
+ * Copyright 2022 Adobe. All rights reserved.
3
3
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
4
  * you may not use this file except in compliance with the License. You may obtain a copy
5
5
  * of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -12,7 +12,6 @@
12
12
  /* eslint-disable no-param-reassign */
13
13
  import assert from 'assert';
14
14
  import { visit } from 'unist-util-visit';
15
- import mime from 'mime';
16
15
  import processQueue from '@adobe/helix-shared-process-queue';
17
16
 
18
17
  /**
@@ -42,33 +41,9 @@ async function getBlob(handler, data, contentType, source) {
42
41
  };
43
42
  }
44
43
 
45
- let blob;
46
- if ('createExternalResource' in handler) {
47
- blob = data instanceof Buffer
48
- ? handler.createExternalResource(data, data.length, contentType, source)
49
- : await handler.createExternalResourceFromStream(data.stream, data.size, contentType, source);
50
-
51
- let suffix = '';
52
- if (blob.contentType && !blob.uri.startsWith('data:')) {
53
- const types = blob.contentType.split('/');
54
- let ext = mime.getExtension(blob.contentType);
55
- // handle wrong jpg content-type
56
- if (!ext && blob.contentType === 'image/jpg') {
57
- ext = 'jpg';
58
- }
59
- if (ext && ext !== 'bin') {
60
- suffix = `#${types[0]}.${ext}`;
61
- }
62
- if (blob.meta && blob.meta.width && blob.meta.height) {
63
- suffix = `${suffix}?width=${blob.meta.width}&width=${blob.meta.height}`;
64
- }
65
- }
66
- blob.uri = `${blob.uri}${suffix}`;
67
- } else {
68
- blob = data instanceof Buffer
69
- ? handler.createMediaResource(data, data.length, contentType, source)
70
- : await handler.createMediaResourceFromStream(data.stream, data.size, contentType, source);
71
- }
44
+ const blob = data instanceof Buffer
45
+ ? handler.createMediaResource(data, data.length, contentType, source)
46
+ : await handler.createMediaResourceFromStream(data.stream, data.size, contentType, source);
72
47
  const exists = await handler.checkBlobExists(blob);
73
48
  if (!exists) {
74
49
  await handler.upload(blob);