@adobe/helix-html-pipeline 6.28.5 → 6.28.6

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,10 @@
1
+ ## [6.28.6](https://github.com/adobe/helix-html-pipeline/compare/v6.28.5...v6.28.6) (2026-04-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * 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))
7
+
1
8
  ## [6.28.5](https://github.com/adobe/helix-html-pipeline/compare/v6.28.4...v6.28.5) (2026-04-13)
2
9
 
3
10
 
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.6",
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
  }