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

Astro breaks download attribute in <a> tags in MDX files #13567

Open
1 task
dschuessler opened this issue Apr 6, 2025 · 0 comments
Open
1 task

Astro breaks download attribute in <a> tags in MDX files #13567

dschuessler opened this issue Apr 6, 2025 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@dschuessler
Copy link

Astro Info

Astro                    v5.5.4
Node                     v20.19.0
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             auto-import
                         astro-expressive-code
                         @astrojs/mdx

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

No response

Describe the Bug

If this...

<a href="https://astro.build/_astro/astro-cap.jt5HlOg8_12GvP4.webp" download>Download</a>

...turns up in an MDX file processed by Astro, it is turned into this...

<a href="https://astro.build/_astro/astro-cap.jt5HlOg8_12GvP4.webp" download="true">Download</a>

Since the value of the download attribute determines the name of the downloaded file, the file name is astro-cap.jt5HlOg8_12GvP4.webp in the first case but true.webp in the second.

I cannot reproduce this using the MDX playground, so I guess it is an Astro bug.

Potentially related PR: https://github.com/withastro/astro/pull/12584/files

What's the expected result?

Astro does not change the name of downloaded files to "true" by changing the download attribute in <a> tags.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-p68my6rx?file=src%2Fpages%2Findex.astro

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 Apr 6, 2025
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

1 participant