-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Markdown Render VSCode Command Link #140733
Comments
can i take this? |
I think they'd be happy if you created a PR. For completeness:
but the cursor does not change to a hand icon like if |
Thanks, will take a look |
This is what I found. In markdown links are detected at two places:
That's why I couldn't get |
You'll need to register a command for it to take an action. The example in the link is probably the easiest. After registration create a MarkdownString containing the registered command. In regards to the linked example:
You should be able to click on it and see the console log. Note that the cursor doesn't change to a hand icon. |
@rbrisita Have you found any solution? For me even |
The way I implemented Markdown and executing a registered command (through package.json) was by adding a const stop = '# [$(debug-stop)](command:my_ext.stop)';
const table = `
<table>
<tbody>
<tr>
<td align="center">
${stop}
</td>
</tr>
</tbody>
</table>
`;
mds.value = table;
statusBar.tooltip = mds; Make sure you are using the correct VS Code version too. |
Fixes microsoft#140733 This moves the custom logic for rendering links in markdown to run against the rendered results. This means that it also now applies to raw `<a>` tags if html rendering is enabled
Fixes #140733 This moves the custom logic for rendering links in markdown to run against the rendered results. This means that it also now applies to raw `<a>` tags if html rendering is enabled
Command links in |
@mjbvz where should links work? I tried this in a completion item
|
@TylerLeonhardt Sorry for not adding verification details. The markdown string needs to both trusted and have html enabled: const docs = new vscode.MarkdownString(`<a href="command:workbench.action.toggleSidebarVisibility">Run It</a>.`);
docs.isTrusted = true;
docs.supportHtml = true; |
Issue Type: Bug
Hello,
Regarding the
MarkdownString
, in Markdown this:[Name](link)
Renders a link. In a VS Code Extension, this is also possible:
[Run It](command:pkg.command)
Creating a link to run a command.
One would think creating an actual anchor link like this:
<a href="command:pkg.command">Run It</a>
Would work but the click does not execute the command.
VS Code version: Code 1.63.0 (7db1a2b, 2021-12-07T05:18:59.299Z)
OS version: Linux arm64 5.15.7-1-MANJARO-ARM
Restricted Mode: No
System Info
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (4)
The text was updated successfully, but these errors were encountered: