@adobe/helix-html-pipeline 6.28.8 → 6.29.1

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.29.1](https://github.com/adobe/helix-html-pipeline/compare/v6.29.0...v6.29.1) (2026-05-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update external fixes ([#1085](https://github.com/adobe/helix-html-pipeline/issues/1085)) ([58c9271](https://github.com/adobe/helix-html-pipeline/commit/58c92712ec61759ef89a14cc34ff94371abce212))
7
+
8
+ # [6.29.0](https://github.com/adobe/helix-html-pipeline/compare/v6.28.8...v6.29.0) (2026-04-30)
9
+
10
+
11
+ ### Features
12
+
13
+ * support id attribute in section metadata ([#1084](https://github.com/adobe/helix-html-pipeline/issues/1084)) ([0dd6f30](https://github.com/adobe/helix-html-pipeline/commit/0dd6f30e70c8305019d098dcadd96a701cd93625))
14
+
1
15
  ## [6.28.8](https://github.com/adobe/helix-html-pipeline/compare/v6.28.7...v6.28.8) (2026-04-19)
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.8",
3
+ "version": "6.29.1",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -56,7 +56,7 @@
56
56
  "mdast-util-to-hast": "13.2.1",
57
57
  "mdast-util-to-string": "4.0.0",
58
58
  "mime": "4.1.0",
59
- "parse5": "8.0.0",
59
+ "parse5": "8.0.1",
60
60
  "rehype-format": "5.0.1",
61
61
  "rehype-parse": "9.0.1",
62
62
  "remark-parse": "11.0.0",
@@ -70,9 +70,9 @@
70
70
  "unist-util-visit-parents": "6.0.2"
71
71
  },
72
72
  "devDependencies": {
73
- "@adobe/eslint-config-helix": "3.0.24",
74
- "@eslint/config-helpers": "0.5.3",
75
- "@markedjs/html-differ": "5.0.4",
73
+ "@adobe/eslint-config-helix": "3.0.26",
74
+ "@eslint/config-helpers": "0.5.5",
75
+ "@markedjs/html-differ": "5.0.5",
76
76
  "@semantic-release/changelog": "6.0.3",
77
77
  "@semantic-release/git": "10.0.1",
78
78
  "@semantic-release/npm": "13.1.5",
@@ -84,8 +84,8 @@
84
84
  "esmock": "2.7.3",
85
85
  "husky": "9.1.7",
86
86
  "js-yaml": "4.1.1",
87
- "jsdom": "29.0.1",
88
- "junit-report-builder": "5.1.1",
87
+ "jsdom": "29.0.2",
88
+ "junit-report-builder": "5.1.2",
89
89
  "lint-staged": "16.4.0",
90
90
  "mocha": "11.7.5",
91
91
  "mocha-multi-reporters": "1.5.1",
@@ -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 { getAbsoluteUrl, toBlockCSSClassNames } from './utils.js';
15
+ import { getAbsoluteUrl, toBlockCSSClassNames, toSectionId } from './utils.js';
16
16
 
17
17
  /**
18
18
  * Checks whether section metadata processing is enabled for the current site.
@@ -107,6 +107,11 @@ export default function extractSectionMetadata(state) {
107
107
  parent.properties.className = [];
108
108
  }
109
109
  parent.properties.className.push(...getStyleClassNames($value));
110
+ } else if (name === 'id') {
111
+ const id = toSectionId(toString($value));
112
+ if (id) {
113
+ parent.properties.id = id;
114
+ }
110
115
  } else {
111
116
  const value = getValueFromNode(state, $value);
112
117
  parent.properties[`data-${name}`] = value;
@@ -80,6 +80,24 @@ export function wrapContent($parent, $node) {
80
80
  $node.children = [$parent];
81
81
  }
82
82
 
83
+ /**
84
+ * Converts the given text to a valid HTML5 identifier (ID/NAME token):
85
+ * - converts to lowercase
86
+ * - collapses invalid characters to a single `-` (keeps letters, digits, `-`, `_`, `:`, `.`)
87
+ * - strips leading non-letter characters (must begin with [a-z])
88
+ * - strips trailing `-`
89
+ *
90
+ * @param {string} text input text
91
+ * @returns {string} the HTML identifier
92
+ */
93
+ export function toSectionId(text) {
94
+ return (text || '')
95
+ .toLowerCase()
96
+ .replace(/[^0-9a-z._:-]+/g, '-')
97
+ .replace(/^[^a-z]+/, '')
98
+ .replace(/-+$/, '');
99
+ }
100
+
83
101
  /**
84
102
  * Converts the given text to an array of CSS class names:
85
103
  * - extracts the list of options (given as CSV in braces at the end)