-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: MDX cannot find relative image path without leading ./ (#10754)
Co-authored-by: Oliver Speir <[email protected]>
- Loading branch information
1 parent
a92e263
commit 3e7a12c
Showing
7 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@astrojs/mdx": patch | ||
--- | ||
|
||
Fixes an issue where images in MDX required a relative specifier (e.g. `./`) | ||
|
||
Now, you can use the standard `![](img.png)` syntax in MDX files for images colocated in the same folder: no relative specifier required! | ||
|
||
There is no need to update your project; your existing images will still continue to work. However, you may wish to remove any relative specifiers from these MDX images as they are no longer necessary: | ||
|
||
```diff | ||
- ![A cute dog](./dog.jpg) | ||
+ ![A cute dog](dog.jpg) | ||
<!-- This dog lives in the same folder as my article! --> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+157 KB
packages/integrations/mdx/test/fixtures/mdx-images/src/pages/houston.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+157 KB
packages/integrations/mdx/test/fixtures/mdx-images/src/pages/relative/houston.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters