code-server-2/lib/vscode/extensions/notebook-markdown-extensions/notebook/emoji.ts

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);
});
}