mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 14:01:38 +01:00
21 lines
812 B
TypeScript
21 lines
812 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Command } from '../commandManager';
|
|
import { MarkdownItEngine } from '../markdownEngine';
|
|
import { ITextDocument } from '../types/textDocument';
|
|
|
|
export class RenderDocument implements Command {
|
|
public readonly id = 'markdown.api.render';
|
|
|
|
public constructor(
|
|
private readonly _engine: MarkdownItEngine
|
|
) { }
|
|
|
|
public async execute(document: ITextDocument | string): Promise<string> {
|
|
return (await (this._engine.render(document))).html;
|
|
}
|
|
}
|