lambda-packages icon indicating copy to clipboard operation
lambda-packages copied to clipboard

@astrojs/image's `Image` hangs if you give it an `alt` prop with `'` in it.

Open jasikpark opened this issue 3 years ago • 0 comments

What version of astro are you using?

1.0.5

Are you using an SSR adapter? If so, which one?

Netlify

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

See https://discord.com/channels/830184174198718474/1020082245916184679 for more context.

When using Image in the blog post I'm working on, I intially wrote:

<Image
  class="blog-image"
  style="display: block; margin: 32px auto; max-height: 600px;"
  src={import("./relays-page-initial-no-relays.png")}
  alt="Relays page with no relays, says 'Adding a dedicated relay is recommended, you currently have one lighthouse acting as a relay.'"
/>

which caused astro to crash with a heap overflow.

<Image
  class="blog-image"
  style="display: block; margin: 32px auto; max-height: 600px;"
  src={import("./relays-page-intial-no-relays.png")}
  alt="Relays page with no relays, says “Adding a dedicated relay is recommended, you currently have one lighthouse acting as a relay.”"
/>

this second version succeeded, which makes me think some string escaping bug is going on.

I used “ and ”, typed via alt+[ and alt+shift+[ on my mac instead of ' for the quotes on the second impl

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-qfamda?file=src/pages/index.mdx

Participation

  • [ ] I am willing to submit a pull request for this issue.

jasikpark avatar Sep 15 '22 22:09 jasikpark