@adobe/helix-html-pipeline 6.20.3 → 6.21.0

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.21.0](https://github.com/adobe/helix-html-pipeline/compare/v6.20.4...v6.21.0) (2025-02-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * **metadata:** html lang attribute ([#824](https://github.com/adobe/helix-html-pipeline/issues/824)) ([fc26c60](https://github.com/adobe/helix-html-pipeline/commit/fc26c608e5a5b61215f1592065a86a0e50d57fa8))
7
+
8
+ ## [6.20.4](https://github.com/adobe/helix-html-pipeline/compare/v6.20.3...v6.20.4) (2025-02-24)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/helix-markdown-support to v7.1.12 ([#827](https://github.com/adobe/helix-html-pipeline/issues/827)) ([fa6dfa0](https://github.com/adobe/helix-html-pipeline/commit/fa6dfa088e4af0c16857cac3b7e5c6f140c52ed7))
14
+
1
15
  ## [6.20.3](https://github.com/adobe/helix-html-pipeline/compare/v6.20.2...v6.20.3) (2025-02-24)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-html-pipeline",
3
- "version": "6.20.3",
3
+ "version": "6.21.0",
4
4
  "description": "Helix HTML Pipeline",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "node": ">=16.x"
43
43
  },
44
44
  "dependencies": {
45
- "@adobe/helix-markdown-support": "7.1.11",
45
+ "@adobe/helix-markdown-support": "7.1.12",
46
46
  "@adobe/helix-shared-utils": "3.0.2",
47
47
  "@adobe/mdast-util-gridtables": "4.0.9",
48
48
  "@adobe/remark-gridtables": "3.0.9",
@@ -67,12 +67,21 @@ export default async function render(state, req, res) {
67
67
  }
68
68
 
69
69
  let jsonLd;
70
+ let htmlLang;
71
+
70
72
  for (const [name, value] of Object.entries(meta.page)) {
71
73
  if (name.toLowerCase() === 'json-ld') {
72
74
  jsonLd = value;
73
75
  // eslint-disable-next-line no-continue
74
76
  continue;
75
77
  }
78
+ if (name.toLowerCase() === 'html-lang') {
79
+ if (/^[a-z]{2}([-_]{1}[A-Z]{2})?$/.test(value)) {
80
+ htmlLang = value;
81
+ }
82
+ // eslint-disable-next-line no-continue
83
+ continue;
84
+ }
76
85
  const attr = name.includes(':') && !name.startsWith('twitter:') ? 'property' : 'name';
77
86
  if (Array.isArray(value)) {
78
87
  for (const v of value) {
@@ -111,7 +120,7 @@ export default async function render(state, req, res) {
111
120
  type: 'root',
112
121
  children: [
113
122
  { type: 'doctype' },
114
- h('html', [
123
+ h('html', htmlLang ? { lang: htmlLang } : null, [
115
124
  $head,
116
125
  h('body', [
117
126
  h('header', []), // todo: are those still required ?