You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VS Code's Markdown engine has stored the URI of document under parsing but it's not exposed to Markdown preview extensions (markdown-it plugins).
Exposing the location of current document (MarkdownEngine.currentDocument) to the second argument of markdown-it functions (env object) would like to be good for contributed extensions. Please let me hear if there is any concern.
Motivation
My extension, marp-team.marp-vscode, has implemented the support of CSS themeing that is separated from markdown.styles built-in preference. I have used a hacky way (execute md.normalizeLink() directly) to get the placed directory of Markdown under parsing. I need it for matching the rule of CSS path resolution into markdown.styles.
Until VS Code 1.39.x, that was expected to get URI to the workspace folder Markdown belongs, or the directory that Markdown is placed.
Unfortunately this is no longer working since 1.40.0 by the change in 36aa903 (reported in marp-team/marp-vscode#100). I tried to fix this but failured because I could not find the correct way to get current document while parsing.
I have recognized the design of markdown.styles to avoid reading arbitrary files (#75039), and I'm sure following this principle should be better to make extension secure.
The text was updated successfully, but these errors were encountered:
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.
🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.
I know I am too late for this feature request, but I think this is comparatively easy to fix and would improve the configurability of markdown-it plugins a lot.
I am currently adding a markdown-it plugin to the Argdown VSCode extension and want to load configuration files specific to the workspace of the currently previewed document. As I do not want to use a "messy workaround" as in the marp plugin, I think I have to give up on this.
The workaround may have misdetection the location of workspace while opening the exactly same 2 Markdowns in different workspaces, so I don't want to use this trick if possible.
VS Code's Markdown engine has stored the URI of document under parsing but it's not exposed to Markdown preview extensions (markdown-it plugins).
Exposing the location of current document (
MarkdownEngine.currentDocument
) to the second argument of markdown-it functions (env
object) would like to be good for contributed extensions. Please let me hear if there is any concern.Motivation
My extension,
marp-team.marp-vscode
, has implemented the support of CSS themeing that is separated frommarkdown.styles
built-in preference. I have used a hacky way (executemd.normalizeLink()
directly) to get the placed directory of Markdown under parsing. I need it for matching the rule of CSS path resolution intomarkdown.styles
.https://github.com/marp-team/marp-vscode/blob/a3dc7bd8d50e97b995a2c7b57f38479cf1696334/src/extension.ts#L30-L32
Until VS Code 1.39.x, that was expected to get URI to the workspace folder Markdown belongs, or the directory that Markdown is placed.
Unfortunately this is no longer working since 1.40.0 by the change in 36aa903 (reported in marp-team/marp-vscode#100). I tried to fix this but failured because I could not find the correct way to get current document while parsing.
I have recognized the design of
markdown.styles
to avoid reading arbitrary files (#75039), and I'm sure following this principle should be better to make extension secure.The text was updated successfully, but these errors were encountered: