@gudhub/ssg-web-components-library 1.0.125 → 1.0.127

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/ssg-web-components-library",
3
- "version": "1.0.125",
3
+ "version": "1.0.127",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -99,7 +99,7 @@ class ImageComponent extends GHComponent {
99
99
  }
100
100
 
101
101
  const payload = {
102
- imageSrc: this.generatedImageSrc,
102
+ imageSrc: relativeImagePath,
103
103
  imageUrl: this.dataUrl ?? null
104
104
  };
105
105
 
@@ -257,13 +257,14 @@ class ImageComponent extends GHComponent {
257
257
  if (!value) return value;
258
258
 
259
259
  return value
260
- .normalize('NFD') // separate diacritics
261
- .replace(/[\u0300-\u036f]/g, '') // remove diacritics
262
- .replace(/[()]/g, '') // remove brackets
263
- .replace(/[^a-zA-Z0-9/._-]+/g, '-') // replace special chars with -
264
- .replace(/-+/g, '-') // collapse multiple -
265
- .replace(/\/-+/g, '/') // avoid "/-"
266
- .replace(/^-|-$/g, '') // trim -
260
+ .normalize('NFD') // separate diacritics
261
+ .replace(/[\u0300-\u036f]/g, '') // remove diacritics
262
+ .normalize('NFC') // recompose unicode letters (важливо для кирилиці)
263
+ .replace(/[()]/g, '') // remove brackets
264
+ .replace(/[^\p{L}\p{N}/._-]+/gu, '-') // replace anything that's not a letter/number (будь-якого алфавіту) with -
265
+ .replace(/-+/g, '-') // collapse multiple -
266
+ .replace(/\/-+/g, '/') // avoid "/-"
267
+ .replace(/^-|-$/g, '') // trim -
267
268
  .toLowerCase();
268
269
  };
269
270
  }