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

fix: using file inclusion, if included file contains relative path, t… #3741

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

windsonR
Copy link

@windsonR windsonR commented Apr 3, 2024

When using markdown file inclusion

The included markdown file(a.md) wll directly copy file content to replace the comment in a file(b.md)

But if the included markdown file contains relative path (such as ![](./a.png)), when access b.html, it will report error(./a.png can not resolve by vite)

reproduce repo

In reproduce repo, i've add a patch to fix this.

This PR replace the relative path to absolute path to fix this problem.

@brc-dd
Copy link
Member

brc-dd commented Apr 26, 2024

This will be a breaking change and not sure if we want that. Including markdown should behave similar to importing components. And if in a vue component you have a path relative to that file, that won't be transformed to something else.

@windsonR
Copy link
Author

It's not like vue component for now. The file inclusion is just copy the markdown file's content to replace the @include comment.

Maybe should re-implement File inclusion?

To make sure that it is not simply copying the content and replacing the file include comment with it, but injecting the compiled markdown file to the comment?

@github-actions github-actions bot added the stale label Jun 9, 2024
@github-actions github-actions bot removed the stale label Jul 17, 2024
@github-actions github-actions bot added the stale label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants