@adobe/helix-html-pipeline 6.22.0 → 6.23.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 +7 -0
- package/package.json +1 -1
- package/src/steps/render.js +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [6.23.0](https://github.com/adobe/helix-html-pipeline/compare/v6.22.0...v6.23.0) (2025-03-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **metatdata:** support hreflang x-default ([#848](https://github.com/adobe/helix-html-pipeline/issues/848)) ([30bf798](https://github.com/adobe/helix-html-pipeline/commit/30bf7986bcf37a98242f3229272613a56a78e39b))
|
|
7
|
+
|
|
1
8
|
# [6.22.0](https://github.com/adobe/helix-html-pipeline/compare/v6.21.6...v6.22.0) (2025-03-20)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/steps/render.js
CHANGED
|
@@ -17,11 +17,9 @@ import rehypeParse from 'rehype-parse';
|
|
|
17
17
|
import { cleanupHeaderValue } from '@adobe/helix-shared-utils';
|
|
18
18
|
import { contentSecurityPolicyOnAST } from './csp.js';
|
|
19
19
|
|
|
20
|
-
const LANG_REGEX = /^[a-z]{2}(?:[-_][a-z]{2})?$/i;
|
|
21
|
-
|
|
22
20
|
function formatLang(lang) {
|
|
23
21
|
return lang
|
|
24
|
-
.
|
|
22
|
+
.replaceAll('_', '-')
|
|
25
23
|
.toLowerCase();
|
|
26
24
|
}
|
|
27
25
|
|
|
@@ -84,7 +82,7 @@ export default async function render(state, req, res) {
|
|
|
84
82
|
continue;
|
|
85
83
|
}
|
|
86
84
|
if (name.toLowerCase() === 'html-lang') {
|
|
87
|
-
if (
|
|
85
|
+
if (value) {
|
|
88
86
|
htmlLang = formatLang(value);
|
|
89
87
|
}
|
|
90
88
|
// eslint-disable-next-line no-continue
|
|
@@ -92,7 +90,7 @@ export default async function render(state, req, res) {
|
|
|
92
90
|
}
|
|
93
91
|
if (name.toLowerCase().startsWith('hreflang-')) {
|
|
94
92
|
const lang = name.substring(9);
|
|
95
|
-
if (
|
|
93
|
+
if (lang) {
|
|
96
94
|
appendElement(
|
|
97
95
|
$head,
|
|
98
96
|
createElement('link', 'rel', 'alternate', 'hreflang', formatLang(lang), 'href', value),
|