mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
This adds a command which renders the provided document, or the active
editor if one is provided. Following the pattern of some of the preview
commands, it returned `undefined` if there's no document provided and
no active text editor. Otherwise, seems to work...
```ts
const html = await vscode.commands.executeCommand<string>('markdown.render');
```
A way to render arbitrary strings in addition to documents may be useful at
some point in the future. However, I didn't implement that here as that'd
require some refactoring of the markdown engine. If we're interested though
I could certainly give that a shot.