@adobe/helix-html-pipeline 6.28.1 → 6.28.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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [6.28.3](https://github.com/adobe/helix-html-pipeline/compare/v6.28.2...v6.28.3) (2026-04-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * support mixed and comma-separated section metadata values ([#1068](https://github.com/adobe/helix-html-pipeline/issues/1068)) ([f18796b](https://github.com/adobe/helix-html-pipeline/commit/f18796b6a6fc03eda3ac9b0a9df86c0b8e590ea1))
7
+
8
+ ## [6.28.2](https://github.com/adobe/helix-html-pipeline/compare/v6.28.1...v6.28.2) (2026-04-09)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * multiple regressions ([#1066](https://github.com/adobe/helix-html-pipeline/issues/1066)) ([e66aa9f](https://github.com/adobe/helix-html-pipeline/commit/e66aa9f13eaec74fdd4520591c4533e7fd5bee77))
14
+
1
15
  ## [6.28.1](https://github.com/adobe/helix-html-pipeline/compare/v6.28.0...v6.28.1) (2026-04-08)
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.1",
3
+ "version": "6.28.3",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -84,7 +84,7 @@
84
84
  "esmock": "2.7.3",
85
85
  "husky": "9.1.7",
86
86
  "js-yaml": "4.1.1",
87
- "jsdom": "28.1.0",
87
+ "jsdom": "29.0.1",
88
88
  "junit-report-builder": "5.1.1",
89
89
  "lint-staged": "16.4.0",
90
90
  "mocha": "11.7.5",
package/src/html-pipe.js CHANGED
@@ -168,8 +168,8 @@ export async function htmlPipe(state, req) {
168
168
  await rewriteUrls(state);
169
169
  await fixSections(state);
170
170
  await createPageBlocks(state);
171
- await extractSectionMetadata(state);
172
171
  await createPictures(state);
172
+ await extractSectionMetadata(state);
173
173
  await extractMetaData(state, req);
174
174
  await rewriteIcons(state);
175
175
  await addHeadingIds(state);
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
  import { toString } from 'hast-util-to-string';
13
- import { SKIP, visit } from 'unist-util-visit';
13
+ import { CONTINUE, SKIP, visit } from 'unist-util-visit';
14
14
  import { toMetaName } from '../utils/modifiers.js';
15
15
  import { toBlockCSSClassNames } from './utils.js';
16
16
 
@@ -29,6 +29,31 @@ function isSectionMetadataEnabled(config) {
29
29
  return new Date(config.created) >= new Date('2026-05-01');
30
30
  }
31
31
 
32
+ /**
33
+ * Extracts a value from a HAST node by collecting image srcs, link hrefs,
34
+ * and text tokens (split by comma/whitespace).
35
+ * @param {object} $value the HAST value node
36
+ * @returns {string} the extracted value
37
+ */
38
+ function getValueFromNode($value) {
39
+ const items = [];
40
+ visit($value, (node) => {
41
+ if (node.tagName === 'img' && node.properties?.src) {
42
+ items.push(node.properties.src);
43
+ return SKIP;
44
+ }
45
+ if (node.tagName === 'a' && node.properties?.href) {
46
+ items.push(node.properties.href);
47
+ return SKIP;
48
+ }
49
+ if (node.type === 'text') {
50
+ items.push(...node.value.trim().split(/[,\s]+/).filter(Boolean));
51
+ }
52
+ return CONTINUE;
53
+ });
54
+ return items.join(',');
55
+ }
56
+
32
57
  /**
33
58
  * Processes section metadata blocks by applying their key/value pairs
34
59
  * as data attributes on the parent section div, with special handling
@@ -53,12 +78,14 @@ export default function extractSectionMetadata(state) {
53
78
  const [$name, $value] = $row.children;
54
79
  const name = toMetaName(toString($name));
55
80
  if (name) {
56
- const value = toString($value).trim();
81
+ const value = getValueFromNode($value);
57
82
  if (name === 'style') {
58
83
  if (!parent.properties.className) {
59
84
  parent.properties.className = [];
60
85
  }
61
- parent.properties.className.push(...toBlockCSSClassNames(value));
86
+ parent.properties.className.push(
87
+ ...value.split(/[,\s]+/).filter(Boolean).flatMap(toBlockCSSClassNames),
88
+ );
62
89
  } else {
63
90
  parent.properties[`data-${name}`] = value;
64
91
  }