Add markdown emoji for testing in notebooks

This commit is contained in:
Matt Bierner 2021-02-22 18:10:27 -08:00
parent b22f8f1169
commit b3a33306fb
7 changed files with 39 additions and 7 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,20 @@
/*---------------------------------------------------------------------------------------------
* 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';
declare const extendMarkdownIt: undefined | (
(f: (md: markdownIt.MarkdownIt) => void) => void
);
(function () {
if (typeof extendMarkdownIt !== 'undefined') {
const emoji = require('markdown-it-emoji');
extendMarkdownIt((md: markdownIt.MarkdownIt) => {
md.use(emoji);
});
}
}());

View file

@ -12,11 +12,10 @@ declare const extendMarkdownIt: undefined | (
(function () {
const katex = require('@iktakahiro/markdown-it-katex');
if (typeof extendMarkdownIt !== 'undefined') {
extendMarkdownIt((md: markdownIt.MarkdownIt) => {
md.use(katex);
});
}
}());

View file

@ -18,8 +18,13 @@
"notebookMarkdownRenderer": [
{
"id": "markdownItRenderer-katex",
"displayName": "Markdown it renderer",
"entrypoint": "./notebook-out/extension.js"
"displayName": "Markdown it katex renderer",
"entrypoint": "./notebook-out/katex.js"
},
{
"id": "markdownItRenderer-emoji",
"displayName": "Markdown it emoji renderer",
"entrypoint": "./notebook-out/emoji.js"
}
]
},
@ -29,7 +34,8 @@
"build-notebook": "npx webpack-cli --config webpack.notebook.js --mode production"
},
"dependencies": {
"@iktakahiro/markdown-it-katex": "^4.0.1"
"@iktakahiro/markdown-it-katex": "^4.0.1",
"markdown-it-emoji": "^2.0.0"
},
"devDependencies": {
"@types/markdown-it": "^0.0.0",

View file

@ -6,7 +6,8 @@ const path = require('path');
module.exports = {
entry: {
extension: './notebook/extension.ts',
katex: './notebook/katex.ts',
emoji: './notebook/emoji.ts',
},
module: {
rules: [

View file

@ -154,6 +154,11 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
markdown-it-emoji@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/markdown-it-emoji/-/markdown-it-emoji-2.0.0.tgz#3164ad4c009efd946e98274f7562ad611089a231"
integrity sha512-39j7/9vP/CPCKbEI44oV8yoPJTpvfeReTn/COgRhSpNrjWF3PfP/JUxxB0hxV6ynOY8KH8Y8aX9NMDdo6z+6YQ==
markdown-it@^12.0.4:
version "12.0.4"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.0.4.tgz#eec8247d296327eac3ba9746bdeec9cfcc751e33"