@adobe/helix-html-pipeline 6.28.3 → 6.28.5
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 +14 -0
- package/package.json +2 -2
- package/src/steps/extract-section-metadata.js +23 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [6.28.5](https://github.com/adobe/helix-html-pipeline/compare/v6.28.4...v6.28.5) (2026-04-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **deps:** update dependency @adobe/mdast-util-gridtables to v4.0.19 ([#1073](https://github.com/adobe/helix-html-pipeline/issues/1073)) ([ef1718f](https://github.com/adobe/helix-html-pipeline/commit/ef1718f5ec31794d6968f147a311f44ca8f18ce0))
|
|
7
|
+
|
|
8
|
+
## [6.28.4](https://github.com/adobe/helix-html-pipeline/compare/v6.28.3...v6.28.4) (2026-04-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 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))
|
|
14
|
+
|
|
1
15
|
## [6.28.3](https://github.com/adobe/helix-html-pipeline/compare/v6.28.2...v6.28.3) (2026-04-10)
|
|
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.
|
|
3
|
+
"version": "6.28.5",
|
|
4
4
|
"description": "Helix HTML Pipeline",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@adobe/helix-markdown-support": "7.1.18",
|
|
46
46
|
"@adobe/helix-shared-utils": "3.0.2",
|
|
47
|
-
"@adobe/mdast-util-gridtables": "4.0.
|
|
47
|
+
"@adobe/mdast-util-gridtables": "4.0.19",
|
|
48
48
|
"@adobe/remark-gridtables": "3.0.19",
|
|
49
49
|
"github-slugger": "2.0.0",
|
|
50
50
|
"hast-util-raw": "9.1.0",
|
|
@@ -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
|
}
|