Added experimental setting markdown.marp.strictPathResolutionDuringExport
#367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
markdown.marp.strictPathResolutionDuringExport
enables strict path resolution during export.If enabled, the export command tries to resolve relative paths from VS Code workspace that a Markdown file belongs. If not, or the Markdown does not belong to any workspace, the export command resolves paths based on the local file system.
It's useful for getting more consistent result between preview and export.
![]()
that refers the resource in outside of the workspace has not rendered in the preview but rendered in the export result. By enabling this option, the export command tries to resolve images from the workspace proxy so images in the outside won't be rendered as same as the preview.[workspace-root]/markdown/abc.md
,![](/images/xyz.jpg)
is referring to[workspace-root]/images/xyz.jpg
at the workspace root in the preview. However, the export command could not resolve this image because the export process has not known any about of VS Code workspace. In this case, the provided option will make resolvable the image by setting correct base path during export./users/xxx/abc.jpg
andC:\xxx\abc.jpg
should not be rendered, even if the referrenced image has located in the workspace. The preview is following this rule, but Marp's export command is not following. The added option can opt in strict path resolutions like this, and avoid unexpected resource sniffing by inline scripts in Markdown.This option is experimental and disabled by default, to avoid breaking exist user's workflow.
Related