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

Improve resolution of base path in workspace proxy server #359

Merged
merged 8 commits into from
Jun 6, 2022

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jun 3, 2022

I've noticed the workspace proxy server is not handling the base path of workspace URI correctly.

In the multiple workspace, a URI for each workspace root may become virtual-workspace://multiple-workspaces/root. If resolved path such as /abc.jpg, we have to resolve the image from virtual-workspace://multiple-workspaces/root/abc.jpg. However, currently we wrongly resolve virtual-workspace://multiple-workspaces/abc.jpg by following the rule of absolute path.

This change may resolve the file resolution issue in some virtual workspaces, such as #238.

In addition, this fix is opening the door for working on file scheme URI, and it brings more compatible file path resoluition with VS Code's Markdown preview to the export command. (Specifically, /abc.jpg can point at the workspace root, not filesystem root. It may become a breaking change to exist projects so the workspace-based resolution in file scheme should be an optional)

yhatt added 5 commits May 24, 2022 00:13
The workfile provides base path that has been relative from the
workspace root. URI path of workspace root may provide sub-directory
from origin. In previous, we had not processed that path properly.

By this change, workspace proxy server will support `file` scheme in
export command. We can provide the path resolution rule like to Marp
CLI  server mode.
@yhatt yhatt marked this pull request as ready for review June 6, 2022 13:39
@yhatt yhatt changed the title Fix resolution of base path in workspace proxy server Improve resolution of base path in workspace proxy server Jun 6, 2022
@yhatt yhatt merged commit 0c7cd58 into main Jun 6, 2022
@yhatt yhatt deleted the workspace-proxy-improvement branch June 6, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant