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.
An inline image ![]() 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.
If the Markdown file is located in [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.
According to experimental Markdown link validation in VS Code 1.68, the absolute path for local file like /users/xxx/abc.jpg and C:\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
359
354 (The second example would be useful to resolve this case)
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
359
354 (The second example would be useful to resolve this case)