@adobe/helix-html-pipeline 6.26.8 → 6.27.1
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 +14 -0
- package/package.json +6 -6
- package/src/steps/create-pictures.js +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [6.27.1](https://github.com/adobe/helix-html-pipeline/compare/v6.27.0...v6.27.1) (2025-09-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update external fixes ([#943](https://github.com/adobe/helix-html-pipeline/issues/943)) ([2749c7e](https://github.com/adobe/helix-html-pipeline/commit/2749c7e46641509ebed328c52ba4d6b3049feda4))
|
|
7
|
+
|
|
8
|
+
# [6.27.0](https://github.com/adobe/helix-html-pipeline/compare/v6.26.8...v6.27.0) (2025-09-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* lazy load external images ([833614a](https://github.com/adobe/helix-html-pipeline/commit/833614a956be9d19524ff689a9a27b50fd317392)), closes [#919](https://github.com/adobe/helix-html-pipeline/issues/919) [#920](https://github.com/adobe/helix-html-pipeline/issues/920)
|
|
14
|
+
|
|
1
15
|
## [6.26.8](https://github.com/adobe/helix-html-pipeline/compare/v6.26.7...v6.26.8) (2025-09-12)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/helix-html-pipeline",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.27.1",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"lodash.escape": "4.0.1",
|
|
56
56
|
"mdast-util-to-hast": "13.2.0",
|
|
57
57
|
"mdast-util-to-string": "4.0.0",
|
|
58
|
-
"mime": "4.0
|
|
58
|
+
"mime": "4.1.0",
|
|
59
59
|
"parse5": "8.0.0",
|
|
60
60
|
"rehype-format": "5.0.1",
|
|
61
61
|
"rehype-parse": "9.0.1",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"unist-util-visit-parents": "6.0.1"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@adobe/eslint-config-helix": "3.0.
|
|
73
|
+
"@adobe/eslint-config-helix": "3.0.10",
|
|
74
74
|
"@eslint/config-helpers": "0.3.1",
|
|
75
75
|
"@markedjs/html-differ": "5.0.2",
|
|
76
76
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -81,16 +81,16 @@
|
|
|
81
81
|
"eslint-import-resolver-exports": "1.0.0-beta.5",
|
|
82
82
|
"eslint-plugin-header": "3.1.1",
|
|
83
83
|
"eslint-plugin-import": "2.32.0",
|
|
84
|
-
"esmock": "2.7.
|
|
84
|
+
"esmock": "2.7.3",
|
|
85
85
|
"husky": "9.1.7",
|
|
86
86
|
"js-yaml": "4.1.0",
|
|
87
|
-
"jsdom": "
|
|
87
|
+
"jsdom": "27.0.0",
|
|
88
88
|
"junit-report-builder": "5.1.1",
|
|
89
89
|
"lint-staged": "16.1.6",
|
|
90
90
|
"mocha": "11.7.2",
|
|
91
91
|
"mocha-multi-reporters": "1.5.1",
|
|
92
92
|
"mocha-suppress-logs": "0.6.0",
|
|
93
|
-
"semantic-release": "24.2.
|
|
93
|
+
"semantic-release": "24.2.8"
|
|
94
94
|
},
|
|
95
95
|
"lint-staged": {
|
|
96
96
|
"*.js": "eslint",
|
|
@@ -65,8 +65,8 @@ export function createOptimizedPicture(src, alt = '', title = undefined) {
|
|
|
65
65
|
return h('picture', sources);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function
|
|
69
|
-
return node.tagName === 'img' && node.properties?.src
|
|
68
|
+
function isImage(node) {
|
|
69
|
+
return node.tagName === 'img' && node.properties?.src;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -77,8 +77,13 @@ function isMediaImage(node) {
|
|
|
77
77
|
export default async function createPictures({ content }) {
|
|
78
78
|
const { hast } = content;
|
|
79
79
|
|
|
80
|
-
visitParents(hast,
|
|
80
|
+
visitParents(hast, isImage, (img, parents) => {
|
|
81
81
|
const { src, alt, title } = img.properties;
|
|
82
|
+
if (!src.startsWith('./media_')) {
|
|
83
|
+
// external image
|
|
84
|
+
img.properties.loading = 'lazy';
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
82
87
|
const picture = createOptimizedPicture(src, alt, title);
|
|
83
88
|
|
|
84
89
|
// check if parent has style and unwrap if needed
|