@adobe/helix-importer 3.4.0 → 3.4.2

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,17 @@
1
+ ## [3.4.2](https://github.com/adobe/helix-importer/compare/v3.4.1...v3.4.2) (2024-06-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * handle complex background image css property ([551289b](https://github.com/adobe/helix-importer/commit/551289b6ab40bec5eb5101c642759cbc47e8e0e6))
7
+
8
+ ## [3.4.1](https://github.com/adobe/helix-importer/compare/v3.4.0...v3.4.1) (2024-06-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update adobe fixes ([#357](https://github.com/adobe/helix-importer/issues/357)) ([0b648d0](https://github.com/adobe/helix-importer/commit/0b648d04d1815f8da84ffe5a7752b5e84d2febe4))
14
+
1
15
  # [3.4.0](https://github.com/adobe/helix-importer/compare/v3.3.8...v3.4.0) (2024-05-22)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-importer",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "Helix Importer tool: create md / docx from html",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "devDependencies": {
29
29
  "@adobe/eslint-config-helix": "2.0.6",
30
30
  "@adobe/helix-docx2md": "1.6.0",
31
- "@adobe/helix-mediahandler": "2.5.4",
31
+ "@adobe/helix-mediahandler": "2.5.6",
32
32
  "@esm-bundle/chai": "4.3.4-fix.0",
33
33
  "@semantic-release/changelog": "6.0.3",
34
34
  "@semantic-release/exec": "6.0.3",
@@ -41,20 +41,20 @@
41
41
  "dirname-filename-esm": "1.1.1",
42
42
  "eslint": "8.57.0",
43
43
  "husky": "9.0.11",
44
- "jsdom": "24.0.0",
45
- "lint-staged": "15.2.2",
44
+ "jsdom": "24.1.0",
45
+ "lint-staged": "15.2.5",
46
46
  "mocha": "10.4.0",
47
47
  "mocha-multi-reporters": "1.5.1",
48
48
  "mock-fs": "5.2.0",
49
49
  "remark-parse": "11.0.0",
50
- "semantic-release": "23.1.1",
50
+ "semantic-release": "24.0.0",
51
51
  "unist-util-inspect": "8.0.0"
52
52
  },
53
53
  "license": "Apache-2.0",
54
54
  "dependencies": {
55
55
  "@adobe/helix-markdown-support": "7.1.2",
56
- "@adobe/helix-md2docx": "2.1.56",
57
- "@adobe/mdast-util-gridtables": "4.0.4",
56
+ "@adobe/helix-md2docx": "2.1.57",
57
+ "@adobe/mdast-util-gridtables": "4.0.5",
58
58
  "@adobe/remark-gridtables": "3.0.4",
59
59
  "form-data": "4.0.0",
60
60
  "fs-extra": "11.2.0",
@@ -261,9 +261,9 @@ export default class DOMUtils {
261
261
  const prop = split.shift();
262
262
  const value = split.join(':').trim();
263
263
  if (prop === 'background-image') {
264
- const trimmedValue = value.replace(/\s/g, '');
264
+ const sanitizedValue = value.replace(/\s/g, '').split(',').shift();
265
265
  const elStyle = element.style;
266
- elStyle.backgroundImage = trimmedValue;
266
+ elStyle.backgroundImage = sanitizedValue;
267
267
  }
268
268
  });
269
269
  const url = element.style.backgroundImage;
@@ -423,6 +423,10 @@ describe('DOMUtils#getImgFromBackground', () => {
423
423
  test(createElement('p', {}, { 'background-image': 'url(http://localhost:3001/image.jpg)' }, 'Some content'), '<img src="http://localhost:3001/image.jpg">');
424
424
  });
425
425
 
426
+ it('with complex background-image style', () => {
427
+ test(createElement('p', { style: 'background-image:url("https://www.server.com/image.jpg"), linear-gradient(transparent, transparent);' }, {}, 'Some content'), '<img src="https://www.server.com/image.jpg">');
428
+ });
429
+
426
430
  // `createElement` uses JSDOM to create the test-DOM
427
431
  // the workaround in DOMUtils#getImgFromBackground exists _precisely_
428
432
  // because of a potential bug in JSDOM due to which it doesn't