Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing multiple images inside a markdown with ![alt](src) #8649

Closed
1 task
ailequal opened this issue Sep 23, 2023 · 3 comments
Closed
1 task

Importing multiple images inside a markdown with ![alt](src) #8649

ailequal opened this issue Sep 23, 2023 · 3 comments
Labels
needs triage Issue needs to be triaged

Comments

@ailequal
Copy link

Astro Info

Astro                    v3.1.2
Node                     v18.18.0
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Starting from a brand new Astro project created with npm create astro@latest -- --template blog I cannot add more than a single image to a markdown file, altough I can do it inside a mdx file. The images are stored under /src/assets (but it seems to not work even under /public).

This is the only commit that I pushed for simulating the problem from a fresh installation.

The error from StackBlitz is the following (which is the same from my computer):

 error   Parse failure: Unexpected token (7:54)
  At file: /home/projects/github-rzgqu4/src/content/blog/test-md.md
  Contents of line 7:                           import Astro__ZmkHF3 from "/src/assets/puppy.jpg";,import Astro__1NHksg from "/src/assets/parrot.jpg";
  File:
    /home/projects/github-rzgqu4/src/content/blog/test-md.md?astroPropagatedAssets
  Stacktrace:
Error: Parse failure: Unexpected token (7:54)
At file: /home/projects/github-rzgqu4/src/content/blog/test-md.md
Contents of line 7:                             import Astro__ZmkHF3 from "/src/assets/puppy.jpg";,import Astro__1NHksg from "/src/assets/parrot.jpg";
    at ssrTransformScript (/home/projects/github-rzgqu4/node_modules/vite/dist/node/chunks/dep-df561101.js:55395:15)
    at ssrTransform (/home/projects/github-rzgqu4/node_modules/vite/dist/node/chunks/dep-df561101.js:55370:12)
    at Object.ssrTransform (/home/projects/github-rzgqu4/node_modules/vite/dist/node/chunks/dep-df561101.js:65044:20)
    at loadAndTransform (/home/projects/github-rzgqu4/node_modules/vite/dist/node/chunks/dep-df561101.js:55041:24)
    at async instantiateModule (/home/projects/github-rzgqu4/node_modules/vite/dist/node/chunks/dep-df561101.js:55927:10)

What's the expected result?

All the images added inside a single markdown file with the sintax ![alt](src) should be correctly displayed and optimized automatically.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-rzgqu4?file=src%2Fcontent%2Fblog%2Ftest-md.md

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 23, 2023
@Princesseuh
Copy link
Member

Fixed by #8633, just not released yet

@ailequal
Copy link
Author

That's good to know! My apologize for opening a duplicated issue.

@Princesseuh
Copy link
Member

That's good to know! My apologize for opening a duplicated issue.

No worries, you couldn't know!

kremalicious added a commit to kremalicious/blog that referenced this issue Sep 23, 2023
* until fix for withastro/astro#8649 has been released
kremalicious added a commit to kremalicious/blog that referenced this issue Sep 23, 2023
* astro-redirect-from prototype

* move out plugin

* switch to astro-redirect-from

* fixes

* new post: astro-redirect-from

* fix dependency

* test fixes

* downgrade and lock astro

* until fix for withastro/astro#8649 has been released

* mention debug json file

* fix e2e test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants