@adobe/helix-html-pipeline 6.28.3 → 6.28.4

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.4](https://github.com/adobe/helix-html-pipeline/compare/v6.28.3...v6.28.4) (2026-04-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * treat section metadata style values like block options ([#1071](https://github.com/adobe/helix-html-pipeline/issues/1071)) ([#1072](https://github.com/adobe/helix-html-pipeline/issues/1072)) ([f6594bc](https://github.com/adobe/helix-html-pipeline/commit/f6594bcc7eca53e3416f085c6599428122d281ca))
7
+
1
8
  ## [6.28.3](https://github.com/adobe/helix-html-pipeline/compare/v6.28.2...v6.28.3) (2026-04-10)
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.3",
3
+ "version": "6.28.4",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -54,6 +54,27 @@ function getValueFromNode($value) {
54
54
  return items.join(',');
55
55
  }
56
56
 
57
+ /**
58
+ * Extracts style class names from a HAST node.
59
+ * Treats {@code <br>} and {@code <p>} boundaries as comma separators,
60
+ * then converts each segment to CSS class names via {@link toBlockCSSClassNames}.
61
+ * @param {object} $node the HAST node
62
+ * @returns {string[]} the extracted class names
63
+ */
64
+ function getStyleClassNames($node) {
65
+ const parts = [];
66
+ visit($node, (node) => {
67
+ if (node.tagName === 'br') {
68
+ return SKIP;
69
+ }
70
+ if (node.type === 'text') {
71
+ parts.push(...node.value.split(','));
72
+ }
73
+ return CONTINUE;
74
+ });
75
+ return parts.flatMap(toBlockCSSClassNames);
76
+ }
77
+
57
78
  /**
58
79
  * Processes section metadata blocks by applying their key/value pairs
59
80
  * as data attributes on the parent section div, with special handling
@@ -78,15 +99,13 @@ export default function extractSectionMetadata(state) {
78
99
  const [$name, $value] = $row.children;
79
100
  const name = toMetaName(toString($name));
80
101
  if (name) {
81
- const value = getValueFromNode($value);
82
102
  if (name === 'style') {
83
103
  if (!parent.properties.className) {
84
104
  parent.properties.className = [];
85
105
  }
86
- parent.properties.className.push(
87
- ...value.split(/[,\s]+/).filter(Boolean).flatMap(toBlockCSSClassNames),
88
- );
106
+ parent.properties.className.push(...getStyleClassNames($value));
89
107
  } else {
108
+ const value = getValueFromNode($value);
90
109
  parent.properties[`data-${name}`] = value;
91
110
  }
92
111
  }