提交 41b6008e 编写于 作者: P Peng Lyu

markdown renderer support marked options.

上级 9cea9f30
......@@ -25,7 +25,7 @@ export interface MarkdownRenderOptions extends FormattedTextRenderOptions {
/**
* Create html nodes for the given content element.
*/
export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRenderOptions = {}): HTMLElement {
export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRenderOptions = {}, markedOptions: marked.MarkedOptions = {}): HTMLElement {
const element = createElement(options);
const _uriMassage = function (part: string): string {
......@@ -169,10 +169,8 @@ export function renderMarkdown(markdown: IMarkdownString, options: MarkdownRende
}));
}
const markedOptions: marked.MarkedOptions = {
sanitize: true,
renderer
};
markedOptions.sanitize = true;
markedOptions.renderer = renderer;
const allowedSchemes = [Schemas.http, Schemas.https, Schemas.mailto, Schemas.data, Schemas.file, Schemas.vscodeRemote, Schemas.vscodeRemoteResource];
if (markdown.isTrusted) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册