@adobe/helix-html-pipeline 6.28.0 → 6.28.2

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.2](https://github.com/adobe/helix-html-pipeline/compare/v6.28.1...v6.28.2) (2026-04-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * multiple regressions ([#1066](https://github.com/adobe/helix-html-pipeline/issues/1066)) ([e66aa9f](https://github.com/adobe/helix-html-pipeline/commit/e66aa9f13eaec74fdd4520591c4533e7fd5bee77))
7
+
8
+ ## [6.28.1](https://github.com/adobe/helix-html-pipeline/compare/v6.28.0...v6.28.1) (2026-04-08)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * delay section metadata rollout to may 1 ([#1064](https://github.com/adobe/helix-html-pipeline/issues/1064)) ([5d69951](https://github.com/adobe/helix-html-pipeline/commit/5d69951459ff168595a1213c0e10627ee3970a00))
14
+
1
15
  # [6.28.0](https://github.com/adobe/helix-html-pipeline/compare/v6.27.30...v6.28.0) (2026-03-31)
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.0",
3
+ "version": "6.28.2",
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.2"
71
71
  },
72
72
  "devDependencies": {
73
- "@adobe/eslint-config-helix": "3.0.23",
73
+ "@adobe/eslint-config-helix": "3.0.24",
74
74
  "@eslint/config-helpers": "0.5.3",
75
75
  "@markedjs/html-differ": "5.0.4",
76
76
  "@semantic-release/changelog": "6.0.3",
@@ -10,14 +10,14 @@
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
 
17
17
  /**
18
18
  * Checks whether section metadata processing is enabled for the current site.
19
19
  * It is enabled if the rendering version is >= 2, or if no version is set
20
- * and the site was created on or after April 15, 2026.
20
+ * and the site was created on or after May 1, 2026.
21
21
  * @param {PipelineSiteConfig} config
22
22
  * @returns {boolean}
23
23
  */
@@ -26,7 +26,32 @@ function isSectionMetadataEnabled(config) {
26
26
  if (version !== undefined) {
27
27
  return version >= 2;
28
28
  }
29
- return new Date(config.created) >= new Date('2026-04-15');
29
+ return new Date(config.created) >= new Date('2026-05-01');
30
+ }
31
+
32
+ /**
33
+ * Extracts a value from a HAST node by looking for image src or link href attributes.
34
+ * Falls back to text content if no images or links are found.
35
+ * @param {object} $value the HAST value node
36
+ * @returns {string} the extracted value
37
+ */
38
+ function getValueFromNode($value) {
39
+ const urls = [];
40
+ visit($value, (node) => {
41
+ if (node.tagName === 'img' && node.properties?.src) {
42
+ urls.push(node.properties.src);
43
+ return SKIP;
44
+ }
45
+ if (node.tagName === 'a' && node.properties?.href) {
46
+ urls.push(node.properties.href);
47
+ return SKIP;
48
+ }
49
+ return CONTINUE;
50
+ });
51
+ if (urls.length) {
52
+ return urls.join(',');
53
+ }
54
+ return toString($value).trim();
30
55
  }
31
56
 
32
57
  /**
@@ -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
  }
@@ -91,7 +91,9 @@ function sectiontype(section) {
91
91
  let prefix = 'has';
92
92
  if (p.type === 'text') {
93
93
  // do not count "empty" paragraphs
94
- if (p.value === '\n' || p.value === '') return;
94
+ if (p.value === '\n' || p.value === '') {
95
+ return;
96
+ }
95
97
 
96
98
  // paragraph with type text "is" a text
97
99
  prefix = 'is';