@adobe/helix-importer 3.2.1 → 3.2.3
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 +15 -0
- package/package.json +8 -8
- package/src/utils/DOMUtils.js +2 -2
- package/test/utils/DOMUtils.spec.js +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [3.2.3](https://github.com/adobe/helix-importer/compare/v3.2.2...v3.2.3) (2024-02-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* improve comment cleanup regex ([0a16dc5](https://github.com/adobe/helix-importer/commit/0a16dc527d792f2f1485abf550367ce5deaf3216))
|
|
7
|
+
* improve comment cleanup regex ([8f1a7cd](https://github.com/adobe/helix-importer/commit/8f1a7cd0658ae85e084b557480c576b2624c5a6f))
|
|
8
|
+
|
|
9
|
+
## [3.2.2](https://github.com/adobe/helix-importer/compare/v3.2.1...v3.2.2) (2024-01-30)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **deps:** update dependency @adobe/helix-md2docx to v2.1.41 ([#302](https://github.com/adobe/helix-importer/issues/302)) ([3feed69](https://github.com/adobe/helix-importer/commit/3feed6927ac4ef29f107eb97740ef32427cce223))
|
|
15
|
+
|
|
1
16
|
## [3.2.1](https://github.com/adobe/helix-importer/compare/v3.2.0...v3.2.1) (2024-01-30)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-importer",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Helix Importer tool: create md / docx from html",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"*.js": "eslint"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@adobe/eslint-config-helix": "2.0.
|
|
30
|
-
"@adobe/helix-docx2md": "1.5.
|
|
31
|
-
"@adobe/helix-mediahandler": "2.4.
|
|
29
|
+
"@adobe/eslint-config-helix": "2.0.6",
|
|
30
|
+
"@adobe/helix-docx2md": "1.5.1",
|
|
31
|
+
"@adobe/helix-mediahandler": "2.4.9",
|
|
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",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"chai": "5.0.3",
|
|
41
41
|
"dirname-filename-esm": "1.1.1",
|
|
42
42
|
"eslint": "8.56.0",
|
|
43
|
-
"husky": "9.0.
|
|
43
|
+
"husky": "9.0.10",
|
|
44
44
|
"jsdom": "24.0.0",
|
|
45
|
-
"lint-staged": "15.2.
|
|
46
|
-
"mocha": "10.
|
|
45
|
+
"lint-staged": "15.2.2",
|
|
46
|
+
"mocha": "10.3.0",
|
|
47
47
|
"mocha-multi-reporters": "1.5.1",
|
|
48
48
|
"mock-fs": "5.2.0",
|
|
49
49
|
"remark-parse": "11.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"license": "Apache-2.0",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@adobe/helix-markdown-support": "7.1.0",
|
|
56
|
-
"@adobe/helix-md2docx": "2.1.
|
|
56
|
+
"@adobe/helix-md2docx": "2.1.41",
|
|
57
57
|
"@adobe/mdast-util-gridtables": "4.0.0",
|
|
58
58
|
"@adobe/remark-gridtables": "3.0.0",
|
|
59
59
|
"form-data": "4.0.0",
|
package/src/utils/DOMUtils.js
CHANGED
|
@@ -139,8 +139,8 @@ export default class DOMUtils {
|
|
|
139
139
|
// eslint-disable-next-line no-param-reassign
|
|
140
140
|
document.body.innerHTML = document.body.innerHTML
|
|
141
141
|
// remove html comments
|
|
142
|
-
.replace(
|
|
143
|
-
.replace(
|
|
142
|
+
.replace(/(>\s*)<!--(?!>)[\S\s]*?-->/gm, '$1')
|
|
143
|
+
.replace(/<!--(?!>)[\S\s]*?-->/gm, '');
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
static removeSpans(document) {
|
|
@@ -182,6 +182,8 @@ describe('DOMUtils#removeCommments tests', () => {
|
|
|
182
182
|
test('<p><!-- useless comment \n multiline --></p>', '<p></p>');
|
|
183
183
|
test('<p><!-- useless comment \n multiline \n multiline --></p>', '<p></p>');
|
|
184
184
|
test('<!-- useless comment --><p>The content stays</p><!-- another useless comment with \n line break -->', '<p>The content stays</p>');
|
|
185
|
+
test('<p>The content stays<!-- useless comment inside an element --></p>', '<p>The content stays</p>');
|
|
186
|
+
test('<p>The content and spaces stay</p> <!-- a useless comment preceded by spaces -->', '<p>The content and spaces stay</p> ');
|
|
185
187
|
test('<p>This is a paragraph.</p>\n\x3C!--\n<p>Look at this cool image:</p>\n<img border="0" src="pic_trulli.jpg" alt="Trulli">\n-->\n<p>This is a paragraph too.</p>\x3C!-- same line -->\n\x3C!-- single line -->', '<p>This is a paragraph.</p>\n\n<p>This is a paragraph too.</p>\n');
|
|
186
188
|
test('<div some-crazy-attribute="" <!--=""><!-- useless comment --></div>', '<div some-crazy-attribute="" <!--=""></div>');
|
|
187
189
|
});
|