@adobe/helix-html-pipeline 6.28.5 → 6.28.7

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
+ ## [6.28.7](https://github.com/adobe/helix-html-pipeline/compare/v6.28.6...v6.28.7) (2026-04-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * absolutify section metadata URLs relative to page path ([#1075](https://github.com/adobe/helix-html-pipeline/issues/1075)) ([#1076](https://github.com/adobe/helix-html-pipeline/issues/1076)) ([07cbacc](https://github.com/adobe/helix-html-pipeline/commit/07cbacc287cd4c5630098ff7b7f8a5eaa60d5954))
7
+
8
+ ## [6.28.6](https://github.com/adobe/helix-html-pipeline/compare/v6.28.5...v6.28.6) (2026-04-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * absolutify img and link URLs in section metadata ([#1069](https://github.com/adobe/helix-html-pipeline/issues/1069)) ([#1070](https://github.com/adobe/helix-html-pipeline/issues/1070)) ([20eed7e](https://github.com/adobe/helix-html-pipeline/commit/20eed7e2173869f6792ae131b98053e186b75d34))
14
+
1
15
  ## [6.28.5](https://github.com/adobe/helix-html-pipeline/compare/v6.28.4...v6.28.5) (2026-04-13)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.28.5",
3
+ "version": "6.28.7",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  import { toString } from 'hast-util-to-string';
13
13
  import { CONTINUE, SKIP, visit } from 'unist-util-visit';
14
14
  import { toMetaName } from '../utils/modifiers.js';
15
- import { toBlockCSSClassNames } from './utils.js';
15
+ import { getAbsoluteUrl, toBlockCSSClassNames } from './utils.js';
16
16
 
17
17
  /**
18
18
  * Checks whether section metadata processing is enabled for the current site.
@@ -32,18 +32,21 @@ function isSectionMetadataEnabled(config) {
32
32
  /**
33
33
  * Extracts a value from a HAST node by collecting image srcs, link hrefs,
34
34
  * and text tokens (split by comma/whitespace).
35
+ * @param {PipelineState} state
35
36
  * @param {object} $value the HAST value node
36
37
  * @returns {string} the extracted value
37
38
  */
38
- function getValueFromNode($value) {
39
+ function getValueFromNode(state, $value) {
39
40
  const items = [];
40
41
  visit($value, (node) => {
41
42
  if (node.tagName === 'img' && node.properties?.src) {
42
- items.push(node.properties.src);
43
+ const { src } = node.properties;
44
+ items.push(src.startsWith('https://') ? src : getAbsoluteUrl(state, src));
43
45
  return SKIP;
44
46
  }
45
47
  if (node.tagName === 'a' && node.properties?.href) {
46
- items.push(node.properties.href);
48
+ const { href } = node.properties;
49
+ items.push(href.startsWith('https://') ? href : getAbsoluteUrl(state, href));
47
50
  return SKIP;
48
51
  }
49
52
  if (node.type === 'text') {
@@ -105,7 +108,7 @@ export default function extractSectionMetadata(state) {
105
108
  }
106
109
  parent.properties.className.push(...getStyleClassNames($value));
107
110
  } else {
108
- const value = getValueFromNode($value);
111
+ const value = getValueFromNode(state, $value);
109
112
  parent.properties[`data-${name}`] = value;
110
113
  }
111
114
  }
@@ -191,7 +191,7 @@ export function getAbsoluteUrl(state, url) {
191
191
  if (typeof url !== 'string') {
192
192
  return null;
193
193
  }
194
- return resolveUrl(`https://${state.prodHost}/`, url);
194
+ return resolveUrl(`https://${state.prodHost}${state.info?.path || '/'}`, url);
195
195
  }
196
196
 
197
197
  /**