nuxt-og-image 6.7.7 → 6.7.8

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.16.0"
5
5
  },
6
6
  "configKey": "ogImage",
7
- "version": "6.7.7",
7
+ "version": "6.7.8",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "3.6.1"
@@ -18,6 +18,7 @@ const RE_HASH_SEGMENT = /^o_([a-z0-9]+)$/i;
18
18
  const RE_COMMA_PARAM_SEPARATOR = /,(?=\w+_)/;
19
19
  const RE_SIGNATURE_SUFFIX = /,s_[^,]+$/;
20
20
  const RE_NON_ASCII = /[^\u0000-\u007F]/;
21
+ const RE_WINDOWS_RESERVED_FILENAME_CHARACTERS = /[<>:"/\\|?*\u0000-\u001F]/;
21
22
  const PARAM_ALIASES = {
22
23
  w: "width",
23
24
  h: "height",
@@ -149,7 +150,7 @@ export function encodeOgImageParams(options, defaults) {
149
150
  } else {
150
151
  const escaped = str.startsWith("~") ? `~${str}` : str;
151
152
  const encoded = encodeURIComponent(escaped.replace(RE_UNDERSCORE, "__")).replace(RE_PERCENT20, "+");
152
- if (encoded.includes("%")) {
153
+ if (encoded.includes("%") || RE_WINDOWS_RESERVED_FILENAME_CHARACTERS.test(str)) {
153
154
  parts.push(`${alias}_~${b64Encode(str)}`);
154
155
  } else {
155
156
  parts.push(`${alias}_${encoded}`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "6.7.7",
4
+ "version": "6.7.8",
5
5
  "description": "Enlightened OG Image generation for Nuxt.",
6
6
  "author": {
7
7
  "website": "https://harlanzw.com",