astro 4.5.17 → 4.5.18

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.
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "4.5.17";
1
+ const ASTRO_VERSION = "4.5.18";
2
2
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
3
3
  const ROUTE_TYPE_HEADER = "X-Astro-Route-Type";
4
4
  const DEFAULT_404_COMPONENT = "astro-default-404";
@@ -23,7 +23,7 @@ async function dev(inlineConfig) {
23
23
  base: restart.container.settings.config.base
24
24
  })
25
25
  );
26
- const currentVersion = "4.5.17";
26
+ const currentVersion = "4.5.18";
27
27
  if (currentVersion.includes("-")) {
28
28
  logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
29
29
  }
@@ -36,7 +36,7 @@ function serverStart({
36
36
  host,
37
37
  base
38
38
  }) {
39
- const version = "4.5.17";
39
+ const version = "4.5.18";
40
40
  const localPrefix = `${dim("\u2503")} Local `;
41
41
  const networkPrefix = `${dim("\u2503")} Network `;
42
42
  const emptyPrefix = " ".repeat(11);
@@ -261,7 +261,7 @@ function printHelp({
261
261
  message.push(
262
262
  linebreak(),
263
263
  ` ${bgGreen(black(` ${commandName} `))} ${green(
264
- `v${"4.5.17"}`
264
+ `v${"4.5.18"}`
265
265
  )} ${headline}`
266
266
  );
267
267
  }
@@ -96,6 +96,7 @@ const aria_non_interactive_roles = [
96
96
  "toolbar",
97
97
  "tooltip"
98
98
  ];
99
+ const roleless_elements = ["div", "span"];
99
100
  const a11y_required_content = [
100
101
  // anchor-has-content
101
102
  "a",
@@ -422,6 +423,8 @@ const a11y = [
422
423
  return false;
423
424
  if (!ariaRoles.has(role))
424
425
  return false;
426
+ if (roleless_elements.includes(element.localName))
427
+ return false;
425
428
  if (aria_non_interactive_roles.includes(role))
426
429
  return true;
427
430
  }
@@ -442,6 +445,8 @@ const a11y = [
442
445
  const exceptions = a11y_non_interactive_element_to_interactive_role_exceptions[element.localName];
443
446
  if (exceptions?.includes(role))
444
447
  return false;
448
+ if (roleless_elements.includes(element.localName))
449
+ return false;
445
450
  if (!aria_non_interactive_roles.includes(role))
446
451
  return true;
447
452
  }
@@ -70,7 +70,7 @@ Make sure to use the static attribute syntax (\`${key}={value}\`) instead of the
70
70
  if (key === "className") {
71
71
  return markHTMLString(` class="${toAttributeString(value, shouldEscape)}"`);
72
72
  }
73
- if (typeof value === "string" && value.includes("&") && urlCanParse(value)) {
73
+ if (typeof value === "string" && value.includes("&") && isHttpUrl(value)) {
74
74
  return markHTMLString(` ${key}="${toAttributeString(value, false)}"`);
75
75
  }
76
76
  if (value === true && (key.startsWith("data-") || htmlBooleanAttributes.test(key))) {
@@ -146,10 +146,11 @@ function promiseWithResolvers() {
146
146
  reject
147
147
  };
148
148
  }
149
- function urlCanParse(url) {
149
+ const VALID_PROTOCOLS = ["http:", "https:"];
150
+ function isHttpUrl(url) {
150
151
  try {
151
- new URL(url);
152
- return true;
152
+ const parsedUrl = new URL(url);
153
+ return VALID_PROTOCOLS.includes(parsedUrl.protocol);
153
154
  } catch {
154
155
  return false;
155
156
  }
@@ -224,7 +224,7 @@ async function handleRoute({
224
224
  }
225
225
  if (response.status === 404 && response.headers.get(REROUTE_DIRECTIVE_HEADER) !== "no") {
226
226
  const fourOhFourRoute = await matchRoute("/404", manifestData, pipeline);
227
- if (options)
227
+ if (options && options.route !== fourOhFourRoute?.route)
228
228
  return handleRoute({
229
229
  ...options,
230
230
  matchedRoute: fourOhFourRoute,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "4.5.17",
3
+ "version": "4.5.18",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",
@@ -162,8 +162,8 @@
162
162
  "zod": "^3.22.4",
163
163
  "zod-to-json-schema": "^3.22.4",
164
164
  "@astrojs/internal-helpers": "0.4.0",
165
- "@astrojs/markdown-remark": "5.0.0",
166
- "@astrojs/telemetry": "3.0.4"
165
+ "@astrojs/telemetry": "3.0.4",
166
+ "@astrojs/markdown-remark": "5.0.0"
167
167
  },
168
168
  "optionalDependencies": {
169
169
  "sharp": "^0.32.6"