@adobe/helix-html-pipeline 6.27.27 → 6.27.28

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.27.28](https://github.com/adobe/helix-html-pipeline/compare/v6.27.27...v6.27.28) (2026-03-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * hreflang attribute values not spec-compliant ([#1053](https://github.com/adobe/helix-html-pipeline/issues/1053)) ([c23294b](https://github.com/adobe/helix-html-pipeline/commit/c23294be68c9a8b54f9f48aca98b7dd50ee118fa))
7
+
1
8
  ## [6.27.27](https://github.com/adobe/helix-html-pipeline/compare/v6.27.26...v6.27.27) (2026-03-23)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.27.27",
3
+ "version": "6.27.28",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -82,7 +82,7 @@ export default async function render(state, req, res) {
82
82
  // eslint-disable-next-line no-continue
83
83
  continue;
84
84
  }
85
- if (name.toLowerCase().startsWith('hreflang-')) {
85
+ if (name.startsWith('hreflang-')) {
86
86
  const lang = name.substring(9);
87
87
  if (lang) {
88
88
  appendElement(
@@ -15,9 +15,12 @@
15
15
  * @returns {string} the meta name
16
16
  */
17
17
  export function toMetaName(text) {
18
- return text
19
- .toLowerCase()
20
- .replace(/[^0-9a-z:_]/gi, '-');
18
+ const name = text.replace(/[^0-9a-zA-Z:_-]/g, '-');
19
+ // preserve case for hreflang language tags (BCP 47)
20
+ if (name.toLowerCase().startsWith('hreflang-')) {
21
+ return `hreflang-${name.substring(9)}`;
22
+ }
23
+ return name.toLowerCase();
21
24
  }
22
25
 
23
26
  export function globToRegExp(glob) {