mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Core (Remark Image): Support relative import path
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-core': patch
|
||||
---
|
||||
|
||||
Remark Image: Support relative import path
|
||||
@@ -91,6 +91,11 @@ export default {
|
||||
Yields:
|
||||
|
||||
```mdx
|
||||
<img alt="Hello" src"/hello.png" width="1980" height="1080" />
|
||||
<img alt="Test" src"https://example.com/image.png" width="1980" height="1080" />
|
||||
<img alt="Hello" src="/hello.png" width="1980" height="1080" />
|
||||
<img
|
||||
alt="Test"
|
||||
src="https://example.com/image.png"
|
||||
width="1980"
|
||||
height="1080"
|
||||
/>
|
||||
```
|
||||
|
||||
@@ -107,7 +107,10 @@ export function remarkImage({
|
||||
|
||||
importsToInject.push({
|
||||
variableName,
|
||||
importPath: slash(resolveSrc(src, publicDir)),
|
||||
importPath: slash(
|
||||
// with imports, relative paths don't have to be absolute
|
||||
src.startsWith('/') ? path.join(publicDir, src) : src,
|
||||
),
|
||||
});
|
||||
|
||||
Object.assign(node, {
|
||||
|
||||
Reference in New Issue
Block a user