mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
9464d14f31
* Make notebook renderer activate potentially async - Allow activate to be `async` - Make `getRenderer` always return a promise instead of the api result directly * Add comment on why we use async
21 lines
785 B
TypeScript
21 lines
785 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 type * as markdownIt from 'markdown-it';
|
|
|
|
const emoji = require('markdown-it-emoji');
|
|
|
|
export async function activate(ctx: {
|
|
getRenderer: (id: string) => any
|
|
}) {
|
|
const markdownItRenderer = await ctx.getRenderer('markdownItRenderer');
|
|
if (!markdownItRenderer) {
|
|
throw new Error('Could not load markdownItRenderer');
|
|
}
|
|
|
|
markdownItRenderer.extendMarkdownIt((md: markdownIt.MarkdownIt) => {
|
|
return md.use(emoji);
|
|
});
|
|
}
|