@adobe/helix-html-pipeline 6.26.7 → 6.27.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 +14 -0
- package/package.json +6 -6
- package/src/html-pipe.js +1 -1
- package/src/steps/create-pictures.js +8 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [6.27.0](https://github.com/adobe/helix-html-pipeline/compare/v6.26.8...v6.27.0) (2025-09-19)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* 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)
|
|
7
|
+
|
|
8
|
+
## [6.26.8](https://github.com/adobe/helix-html-pipeline/compare/v6.26.7...v6.26.8) (2025-09-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* metadata with multiple colons ([#937](https://github.com/adobe/helix-html-pipeline/issues/937)) ([71daa09](https://github.com/adobe/helix-html-pipeline/commit/71daa09374afbd58b0f6a5e0945663e2753f64e1))
|
|
14
|
+
|
|
1
15
|
## [6.26.7](https://github.com/adobe/helix-html-pipeline/compare/v6.26.6...v6.26.7) (2025-08-20)
|
|
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.0",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -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,13 +81,13 @@
|
|
|
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.2",
|
|
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
|
-
"lint-staged": "16.1.
|
|
90
|
-
"mocha": "11.7.
|
|
89
|
+
"lint-staged": "16.1.6",
|
|
90
|
+
"mocha": "11.7.2",
|
|
91
91
|
"mocha-multi-reporters": "1.5.1",
|
|
92
92
|
"mocha-suppress-logs": "0.6.0",
|
|
93
93
|
"semantic-release": "24.2.7"
|
package/src/html-pipe.js
CHANGED
|
@@ -162,11 +162,11 @@ export async function htmlPipe(state, req) {
|
|
|
162
162
|
await unwrapSoleImages(state);
|
|
163
163
|
await html(state);
|
|
164
164
|
await rewriteUrls(state);
|
|
165
|
-
await rewriteIcons(state);
|
|
166
165
|
await fixSections(state);
|
|
167
166
|
await createPageBlocks(state);
|
|
168
167
|
await createPictures(state);
|
|
169
168
|
await extractMetaData(state, req);
|
|
169
|
+
await rewriteIcons(state);
|
|
170
170
|
await addHeadingIds(state);
|
|
171
171
|
await setCustomResponseHeaders(state, req, res);
|
|
172
172
|
await render(state, req, res);
|
|
@@ -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
|