提交 45a61a82 编写于 作者: M Matt Bierner

Remove simpleMarkedWorker.ts

This markdown renderin worker script is not used as far as I can tell. This change removes it.
上级 639d7deb
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import {WorkerServer} from 'vs/base/common/worker/workerServer';
import {marked} from 'vs/base/common/marked/marked';
function link(href, title, text): string {
return `<a href="#" data-href="${href}" title="${title || text}">${text}</a>`;
}
export const value = {
markdownToHtml(main: WorkerServer, resolve: Function, reject: Function, progress: Function, data: { source: string; highlight: boolean; }): void {
// function highlight(code: string, lang: string, callback?: (error: Error, result: string) => void) {
// main.request('highlight', { code, lang }).then(value => callback(void 0, value), err => callback(err, void 0));
// }
const renderer = new marked.Renderer();
renderer.link = link;
marked(data.source, {
gfm: true,
sanitize: true,
renderer,
// highlight
}, function(err, html) {
if (err) {
reject(err);
} else {
resolve(html);
}
});
}
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册