Skip to content

Commit

Permalink
fix: escape image filenames (withastro#12697)
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored Dec 9, 2024
1 parent 163cfd6 commit 1c4a032
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/famous-teachers-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fix a bug that caused builds to fail if an image had a quote mark in its name
2 changes: 1 addition & 1 deletion packages/astro/src/content/mutable-data-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class MutableDataStore extends ImmutableDataStore {
const exports: Array<string> = [];
this.#assetImports.forEach((id) => {
const symbol = importIdToSymbolName(id);
imports.push(`import ${symbol} from '${id}';`);
imports.push(`import ${symbol} from ${JSON.stringify(id)};`);
exports.push(`[${JSON.stringify(id)}, ${symbol}]`);
});
const code = /* js */ `
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: Endeavour
description: 'Learn about the Endeavour NASA space shuttle.'
publishedDate: 'Sun Jul 11 2021 00:00:00 GMT-0400 (Eastern Daylight Time)'
tags: [space, 90s]
heroImage: "@images/I'm back.jpg"

---

**Source:** [Wikipedia](https://en.wikipedia.org/wiki/Space_Shuttle_Endeavour)
Expand Down

0 comments on commit 1c4a032

Please sign in to comment.